:root {
  --bg: #070908;
  --bg-2: #0c0f0d;
  --panel: rgba(18, 23, 21, 0.92);
  --panel-strong: rgba(24, 29, 26, 0.96);
  --panel-soft: rgba(34, 30, 25, 0.72);
  --line: rgba(142, 165, 151, 0.2);
  --line-strong: rgba(90, 227, 194, 0.34);
  --text: #eff8f1;
  --muted: #92a49a;
  --dim: #68766f;
  --cyan: #48d8df;
  --green: #76e0a0;
  --amber: #f6c65f;
  --rose: #ff718d;
  --ink: #020403;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(80, 120, 100, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 120, 100, 0.08) 1px, transparent 1px),
    linear-gradient(135deg, rgba(10, 14, 12, 0.94), rgba(12, 9, 8, 0.98) 55%, rgba(6, 10, 9, 1));
  background-size:
    34px 34px,
    34px 34px,
    auto;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-frame {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
}

.app-frame::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(72, 216, 223, 0.08), transparent 30%),
    linear-gradient(300deg, transparent 45%, rgba(246, 198, 95, 0.06));
  opacity: 0.9;
}

.activation-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 1.05fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 48px;
  padding: 42px;
  position: relative;
  z-index: 1;
}

.activation-visual {
  min-height: 620px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(13, 20, 17, 0.2), rgba(14, 12, 10, 0.62)),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(118, 224, 160, 0.04) 23px 24px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}

.activation-visual::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -20%;
  height: 28%;
  background: linear-gradient(180deg, transparent, rgba(72, 216, 223, 0.16), transparent);
  animation: scan 4.8s linear infinite;
}

.radar {
  width: min(72vw, 560px);
  aspect-ratio: 1;
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(72, 216, 223, 0.32);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(72, 216, 223, 0.25) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(72, 216, 223, 0.25) 50%, transparent 50.5%);
}

.radar::before,
.radar::after,
.radar span {
  content: "";
  position: absolute;
  border: 1px solid rgba(118, 224, 160, 0.2);
  border-radius: 50%;
  inset: 14%;
}

.radar::after {
  inset: 30%;
}

.radar span:nth-child(1) {
  inset: 45%;
  background: rgba(72, 216, 223, 0.2);
}

.radar span:nth-child(2) {
  width: 48%;
  height: 2px;
  inset: 50% auto auto 50%;
  border: 0;
  border-radius: 0;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(72, 216, 223, 0.95), transparent);
  animation: rotate 3.2s linear infinite;
}

.radar span:nth-child(3) {
  width: 9px;
  height: 9px;
  inset: 28% 25% auto auto;
  border: 0;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(246, 198, 95, 0.76);
}

.signal-stack {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 32px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.signal-stack div {
  height: 72px;
  border: 1px solid rgba(246, 198, 95, 0.24);
  background: linear-gradient(180deg, transparent, rgba(246, 198, 95, 0.14));
  border-radius: var(--radius);
}

.activation-panel {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 32px;
  background: rgba(12, 16, 14, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(72, 216, 223, 0.48);
  border-radius: var(--radius);
  color: var(--cyan);
  background: linear-gradient(145deg, rgba(72, 216, 223, 0.16), rgba(118, 224, 160, 0.08));
  font-weight: 900;
}

.brand-mark.small {
  width: 42px;
  height: 42px;
  font-size: 0.9rem;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  letter-spacing: 0;
}

h2 {
  font-size: clamp(1.5rem, 2vw, 2.1rem);
}

h3 {
  font-size: 1.08rem;
}

.license-box {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

textarea,
input,
select {
  width: 100%;
  color: var(--text);
  background: rgba(6, 9, 8, 0.78);
  border: 1px solid rgba(142, 165, 151, 0.22);
  border-radius: var(--radius);
  outline: none;
  padding: 12px 13px;
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(72, 216, 223, 0.72);
  box-shadow: 0 0 0 3px rgba(72, 216, 223, 0.1);
}

select {
  color-scheme: dark;
}

#licenseInput {
  min-height: 110px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.compact-license-box #licenseInput {
  min-height: 108px;
}

.activation-actions,
.toolbar,
.topbar-tools,
.data-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-btn,
.ghost-btn,
.icon-btn {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 16px;
  color: var(--text);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.primary-btn {
  background: linear-gradient(135deg, rgba(72, 216, 223, 0.92), rgba(118, 224, 160, 0.88));
  color: var(--ink);
  font-weight: 850;
}

.ghost-btn {
  background: rgba(19, 24, 21, 0.76);
  border-color: rgba(142, 165, 151, 0.24);
}

.ghost-btn.danger {
  border-color: rgba(255, 113, 141, 0.42);
  color: #ffacbb;
}

.icon-btn {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  background: rgba(19, 24, 21, 0.86);
  border-color: rgba(72, 216, 223, 0.28);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(72, 216, 223, 0.66);
}

.compact {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.88rem;
}

.status-message {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
}

.status-message.error {
  color: #ffacbb;
}

.status-message.success {
  color: var(--green);
}

.device-strip {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  margin-top: 24px;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.2);
  border-radius: var(--radius);
  background: rgba(4, 6, 5, 0.52);
}

.device-strip span {
  color: var(--muted);
}

code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--amber);
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  position: relative;
  z-index: 1;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  background: rgba(9, 12, 10, 0.9);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
}

.sidebar-brand strong {
  display: block;
}

.sidebar-brand span {
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-btn {
  width: 100%;
  min-height: 44px;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.nav-btn span {
  color: var(--cyan);
  font-size: 1rem;
}

.nav-btn.nav-sub-btn {
  min-height: 36px;
  padding-left: 28px;
  font-size: 0.78rem;
  opacity: 0.9;
}

.nav-module {
  display: grid;
  gap: 3px;
}

.nav-module-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 3px;
  align-items: center;
}

.nav-module-toggle {
  width: 30px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  transition: transform 160ms ease, color 160ms ease, background 160ms ease;
}

.nav-module-toggle:hover {
  color: var(--text);
  background: rgba(72, 216, 223, 0.08);
}

.nav-module.open .nav-module-toggle {
  transform: rotate(180deg);
}

.nav-submenu {
  display: grid;
  gap: 3px;
  margin: 1px 0 3px 20px;
  padding-left: 8px;
  border-left: 1px solid rgba(72, 216, 223, 0.2);
}

.nav-submenu[hidden] {
  display: none;
}

.nav-submenu .nav-btn.nav-sub-btn {
  min-height: 34px;
  padding-left: 8px;
  font-size: 0.76rem;
}

.nav-btn.active,
.nav-btn:hover {
  color: var(--text);
  border-color: rgba(72, 216, 223, 0.28);
  background: rgba(72, 216, 223, 0.08);
}

.sidebar-status {
  margin-top: auto;
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(118, 224, 160, 0.24);
  border-radius: var(--radius);
  background: rgba(13, 18, 15, 0.72);
}

.sidebar-status strong,
.sidebar-status small {
  display: block;
}

.sidebar-status small {
  color: var(--muted);
  margin-top: 3px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(118, 224, 160, 0.56);
  animation: pulse 1.8s infinite;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar {
  min-height: 78px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.mini-stat {
  min-width: 118px;
  min-height: 42px;
  display: grid;
  align-content: center;
  padding: 6px 12px;
  border: 1px solid rgba(142, 165, 151, 0.18);
  border-radius: var(--radius);
  background: rgba(15, 19, 17, 0.68);
}

.mini-stat span {
  color: var(--muted);
  font-size: 0.72rem;
}

.mini-stat strong {
  font-size: 1.05rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

[hidden] {
  display: none !important;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-panel,
.panel,
.license-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.metric-panel {
  min-height: 124px;
  padding: 18px;
  position: relative;
  overflow: hidden;
}

.metric-panel::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: var(--cyan);
}

.accent-green::after {
  background: var(--green);
}

.accent-amber::after {
  background: var(--amber);
}

.accent-rose::after {
  background: var(--rose);
}

.metric-panel span,
.metric-panel small,
.license-stat span {
  color: var(--muted);
}

.metric-panel strong {
  display: block;
  margin: 9px 0 3px;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.button-row.compact-row {
  flex: 0 0 auto;
}

.panel-badge {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(246, 198, 95, 0.34);
  color: var(--amber);
  border-radius: var(--radius);
  font-size: 0.78rem;
  font-weight: 800;
}

.panel-badge.live {
  color: var(--green);
  border-color: rgba(118, 224, 160, 0.34);
}

.radar-board {
  display: grid;
  grid-template-columns: minmax(160px, 0.62fr) minmax(260px, 1fr);
  gap: 14px;
  min-height: 220px;
}

.radar-core {
  aspect-ratio: 1;
  max-height: 220px;
  place-self: center;
  width: 100%;
  border-radius: 50%;
  border: 1px solid rgba(72, 216, 223, 0.32);
  position: relative;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(72, 216, 223, 0.2) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(72, 216, 223, 0.2) 50%, transparent 50.5%),
    rgba(4, 8, 7, 0.46);
  overflow: hidden;
}

.radar-core span {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(118, 224, 160, 0.18);
  border-radius: 50%;
}

.radar-core span:nth-child(2) {
  inset: 32%;
}

.radar-core span:nth-child(3) {
  inset: 48%;
  background: rgba(118, 224, 160, 0.18);
}

.radar-core i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48%;
  height: 2px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(72, 216, 223, 0.95), transparent);
  animation: rotate 3.2s linear infinite;
}

.radar-list,
.pipeline-mini,
.priority-list,
.funnel-list,
.insight-list,
.alert-list,
.task-stream,
.mission-list {
  display: grid;
  gap: 10px;
}

.queue-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 999px;
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.queue-toggle-btn[hidden] {
  display: none;
}

.queue-toggle-btn i {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.queue-toggle-btn.is-open i {
  transform: rotate(225deg);
}

.radar-item,
.priority-item,
.pipeline-item,
.funnel-item,
.task-item,
.mission-item,
.insight-item,
.alert-item {
  border: 1px solid rgba(142, 165, 151, 0.17);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.52);
  padding: 12px;
}

.radar-item,
.priority-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  color: var(--text);
  text-align: left;
}

.radar-item strong,
.priority-item strong,
.task-item strong,
.mission-item strong,
.insight-item strong,
.alert-item strong {
  display: block;
  margin-bottom: 4px;
}

.radar-item span,
.priority-item span,
.task-item span,
.mission-item span,
.pipeline-item span,
.funnel-item span,
.insight-item span,
.alert-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.priority-item:hover {
  border-color: rgba(72, 216, 223, 0.38);
  background: rgba(72, 216, 223, 0.07);
}

.priority-meta {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.priority-meta small {
  color: var(--dim);
  white-space: nowrap;
}

.score-pill,
.status-pill,
.email-grade {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(72, 216, 223, 0.28);
  border-radius: var(--radius);
  color: var(--cyan);
  font-weight: 850;
  white-space: nowrap;
}

.status-pill {
  color: var(--green);
  border-color: rgba(118, 224, 160, 0.3);
  font-size: 0.78rem;
}

.email-grade {
  min-width: 34px;
  margin-right: 6px;
  font-weight: 900;
}

.grade-a,
.grade-b {
  color: var(--green);
  border-color: rgba(118, 224, 160, 0.36);
}

.grade-c {
  color: var(--amber);
  border-color: rgba(246, 198, 95, 0.36);
}

.grade-d,
.grade-f {
  color: var(--rose);
  border-color: rgba(255, 113, 141, 0.4);
}

.email-score {
  color: var(--muted);
  font-size: 0.82rem;
}

.lead-date {
  display: inline-block;
  color: var(--dim);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
}

.email-verification-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pipeline-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.pipeline-item strong {
  font-size: 1.4rem;
}

.funnel-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.funnel-item strong {
  min-width: 24px;
  text-align: right;
  font-size: 1.05rem;
}

.funnel-item .progress-track,
.insight-item .progress-track {
  margin-top: 8px;
}

.insight-item {
  display: grid;
  gap: 8px;
}

.alert-item {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--amber);
}

.alert-item.info {
  border-left-color: var(--cyan);
}

.alert-item.danger {
  border-left-color: var(--rose);
}

.empty-compact {
  min-height: 92px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed rgba(142, 165, 151, 0.22);
  border-radius: var(--radius);
}

.tracking-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(280px, 0.85fr) minmax(260px, 0.7fr);
  gap: 12px;
}

.automation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.automation-stat {
  min-height: 86px;
  border: 1px solid rgba(142, 165, 151, 0.17);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.52);
  padding: 12px;
  display: grid;
  align-content: center;
  gap: 6px;
}

.automation-stat span {
  color: var(--muted);
  font-size: 0.82rem;
}

.automation-stat strong {
  font-size: 1.35rem;
  line-height: 1.15;
}

.automation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.mail-task-progress {
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  margin: 12px 0;
}

.mail-task-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.mail-task-progress-head strong {
  color: var(--ink);
  font-size: 1rem;
}

.mail-task-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(20, 42, 57, 0.12);
  overflow: hidden;
  margin: 10px 0 8px;
}

.mail-task-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0fb7c8, #2f6df6, #f5a623);
  transition: width 0.25s ease;
}

.mail-task-progress small {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.mail-queue-list {
  display: grid;
  gap: 10px;
}

.mail-queue-list-inline {
  margin-top: 14px;
}

.mail-queue-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(20, 42, 57, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.76);
  padding: 12px 14px;
}

.mail-queue-summary strong,
.mail-queue-summary span {
  display: block;
}

.mail-queue-summary strong {
  color: var(--ink);
}

.mail-queue-summary span {
  color: var(--muted);
  margin-top: 3px;
  font-size: 0.9rem;
}

.mail-batch-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(20, 42, 57, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.66);
  padding: 10px;
}

.mail-batch-card.active {
  border-color: rgba(36, 107, 246, 0.28);
  box-shadow: 0 16px 36px rgba(36, 107, 246, 0.08);
}

.mail-batch-summary {
  border: 0;
  background: linear-gradient(135deg, rgba(248, 252, 255, 0.92), rgba(255, 255, 255, 0.92));
}

.mail-batch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mail-batch-send-action {
  box-shadow: 0 8px 20px rgba(25, 39, 52, 0.06);
}

#mailAutomationView .settings-form .form-row {
  grid-template-columns: 1fr;
}

#mailAutomationView select {
  min-width: 0;
}

.seller-profile-panel,
.mail-signature-panel {
  grid-column: 1 / -1;
}

#mailAutomationView .seller-profile-form,
#mailAutomationView .mail-signature-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

#mailAutomationView .seller-profile-form .seller-wide {
  grid-column: span 2;
}

#mailAutomationView .seller-profile-form textarea {
  min-height: 92px;
  resize: vertical;
}

#mailAutomationView .mail-signature-form .form-row {
  display: contents;
}

#mailAutomationView .mail-signature-form .signature-wide {
  grid-column: span 2;
}

#mailAutomationView .mail-signature-form .signature-custom {
  grid-column: span 3;
}

.seller-save-row,
.signature-save-row {
  display: grid;
  gap: 10px;
  align-self: end;
}

.seller-save-row {
  grid-column: 1 / -1;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  align-items: center;
}

.seller-save-row .primary-btn,
.signature-save-row .primary-btn {
  min-height: 54px;
}

.mail-queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(20, 42, 57, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
}

.queue-index-pill {
  width: 58px;
  min-height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, #0aa6b9, #365dff);
  box-shadow: 0 12px 30px rgba(28, 93, 206, 0.18);
}

.mail-queue-main strong,
.mail-queue-main span,
.mail-queue-main small {
  display: block;
}

.mail-queue-main span,
.mail-queue-main small {
  color: var(--muted);
  margin-top: 4px;
}

.mail-queue-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.ghost-btn.compact {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.9rem;
}

.draft-modal[hidden] {
  display: none;
}

.draft-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.draft-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 25, 38, 0.42);
  backdrop-filter: blur(8px);
}

.draft-modal-panel {
  position: relative;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(20, 42, 57, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(18, 32, 47, 0.24);
  padding: 22px;
}

.draft-modal-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 16px;
}

.draft-modal-panel input,
.draft-modal-panel textarea {
  width: 100%;
  border: 1px solid rgba(20, 42, 57, 0.14);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  font: inherit;
}

.draft-modal-panel textarea {
  min-height: 280px;
  line-height: 1.6;
  resize: vertical;
}

.tracking-meter,
.pixel-code-box,
.open-event-list {
  min-height: 150px;
  border: 1px solid rgba(142, 165, 151, 0.17);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.52);
  padding: 14px;
}

.tracking-meter span,
.tracking-meter small,
.pixel-code-box span,
.open-event span {
  display: block;
  color: var(--muted);
}

.tracking-meter strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1;
  color: var(--green);
}

.tracking-meter .progress-track {
  margin-top: 14px;
}

.pixel-code-box {
  display: grid;
  gap: 10px;
  align-content: start;
}

.pixel-code-box code {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.55;
  color: var(--amber);
}

.open-event-list {
  display: grid;
  gap: 8px;
  align-content: start;
}

.open-event {
  display: grid;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(142, 165, 151, 0.12);
}

.open-event:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.open-event strong {
  font-size: 0.92rem;
}

.task-item,
.mission-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, 0.34fr);
  gap: 14px;
  align-items: center;
}

.task-index {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(72, 216, 223, 0.26);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(72, 216, 223, 0.08);
  font-weight: 800;
  font-size: 0.92rem;
}

.progress-track {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(142, 165, 151, 0.13);
}

.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
  border-radius: 999px;
  transition: width 0.25s ease;
}

.task-command {
  display: block;
  margin-top: 7px;
  padding: 8px;
  border: 1px solid rgba(72, 216, 223, 0.18);
  border-radius: 7px;
  color: var(--cyan);
  background: rgba(2, 4, 3, 0.44);
  font-size: 0.76rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.split-grid,
.settings-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.task-form,
.writer-form,
.settings-form {
  display: grid;
  gap: 13px;
}

.keyword-helper-summary,
.task-advanced-options > summary {
  list-style: none;
  cursor: pointer;
}

.keyword-helper-summary::-webkit-details-marker,
.task-advanced-options > summary::-webkit-details-marker {
  display: none;
}

.keyword-helper-summary {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.keyword-helper-summary h3 {
  margin: 2px 0 0;
  font-size: 0.96rem;
}

.keyword-helper-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 900;
  white-space: nowrap;
}

.keyword-helper-action::after,
.task-advanced-options > summary::after {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  content: "";
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.simplified-keyword-helper[open] .keyword-helper-action::after,
.task-advanced-options[open] > summary::after {
  transform: rotate(225deg);
}

.simplified-keyword-helper[open] .keyword-engine-grid {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(25, 39, 52, 0.09);
}

.task-core-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.task-keyword-field,
.task-core-grid .market-field {
  grid-column: 1 / -1;
}

.task-core-grid small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.task-mode-field,
.task-limit-field {
  align-content: start;
  grid-template-rows: auto 42px auto;
}

.task-mode-field select,
.task-limit-field input {
  height: 42px;
  min-height: 42px;
}

.task-mode-field small,
.task-limit-field small {
  min-height: 18px;
}

.task-advanced-options {
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.74);
}

.task-advanced-options > summary {
  display: grid;
  min-height: 46px;
  grid-template-columns: max-content minmax(0, 1fr) 12px;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  color: var(--text);
}

.task-advanced-options > summary span {
  font-weight: 900;
}

.task-advanced-options > summary small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 13px;
  border-top: 1px solid rgba(25, 39, 52, 0.09);
}

.task-advanced-wide {
  grid-column: 1 / -1;
}

.task-launch-bar {
  display: grid;
  gap: 10px;
}

.task-launch-btn {
  width: 100%;
  min-height: 46px;
  font-size: 0.94rem;
}

.task-form-message {
  color: #c43d47;
  font-size: 13px;
  font-weight: 700;
  margin-top: 6px;
}

.search-template-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 2px;
  padding: 12px;
  border: 1px solid rgba(0, 151, 167, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(50, 111, 255, 0.06));
}

.search-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-template-head div {
  display: grid;
  gap: 3px;
}

.search-template-head strong {
  color: var(--text);
  font-size: 0.95rem;
}

.search-template-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

#searchTemplateCount {
  min-width: max-content;
  color: #0891b2;
}

.search-template-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
}

.search-template-controls select {
  grid-column: 1 / -1;
  min-height: 38px;
}

.search-template-controls .ghost-btn.compact {
  min-height: 38px;
  padding: 0 12px;
}

@media (max-width: 1180px) {
  .search-template-controls {
    grid-template-columns: 1fr;
  }
}

#searchTemplateHelper {
  color: var(--muted);
  line-height: 1.5;
}

.panel:has(.task-form) {
  overflow: visible;
}

.field-block {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.filterable-select {
  position: relative;
  z-index: 15;
}

.filterable-select > select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.filterable-select-trigger {
  display: grid;
  width: 100%;
  min-height: 43px;
  grid-template-columns: minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(25, 39, 52, 0.15);
  border-radius: var(--radius);
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.filterable-select-trigger span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterable-select-trigger:focus,
.filterable-select.is-open .filterable-select-trigger {
  border-color: rgba(0, 151, 167, 0.58);
  box-shadow: 0 0 0 4px rgba(0, 151, 167, 0.12);
}

.filterable-select-arrow {
  width: 0;
  height: 0;
  justify-self: center;
  border-right: 5px solid transparent;
  border-left: 5px solid transparent;
  border-top: 6px solid #6b7788;
  transition: transform 0.18s ease;
}

.filterable-select.is-open .filterable-select-arrow {
  transform: rotate(180deg);
}

.filterable-select-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 80;
  border: 1px solid rgba(25, 39, 52, 0.13);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 48px rgba(24, 47, 70, 0.18);
  overflow: hidden;
}

.filterable-select-panel[hidden] {
  display: none;
}

.filterable-select-panel input {
  border: 0;
  border-bottom: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

.filterable-select-panel input:focus {
  border-color: rgba(25, 39, 52, 0.1);
  box-shadow: none;
}

.filterable-select-list {
  display: grid;
  max-height: 290px;
  overflow: auto;
  padding: 6px;
}

.filterable-select-option {
  display: grid;
  gap: 4px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.filterable-select-option span {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 800;
}

.filterable-select-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.filterable-select-option:hover,
.filterable-select-option.is-active {
  background: rgba(0, 151, 167, 0.08);
}

.filterable-select-option.is-selected {
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.11), rgba(50, 111, 255, 0.1));
}

.filterable-select-empty {
  padding: 16px 12px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-align: center;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.settings-helper {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.compact-integration-panel {
  gap: 12px;
  align-self: start;
}

.integration-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.integration-card {
  display: grid;
  gap: 9px;
  padding: 13px 14px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.integration-card.required {
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.08), rgba(50, 111, 255, 0.06));
  box-shadow: inset 4px 0 0 rgba(0, 151, 167, 0.72);
}

.integration-card.optional {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), rgba(255, 255, 255, 0.78));
  box-shadow: inset 4px 0 0 rgba(34, 197, 94, 0.58);
}

.integration-card-header,
.integration-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.integration-card-header div {
  display: grid;
  gap: 3px;
}

.integration-card-header span {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.integration-card-header h4 {
  margin: 0;
  color: var(--text);
  font-size: 0.98rem;
}

.integration-card-header strong {
  padding: 5px 9px;
  border-radius: 999px;
  color: #0f766e;
  background: rgba(20, 184, 166, 0.12);
  font-size: 0.78rem;
  white-space: nowrap;
}

.integration-card label {
  display: grid;
  gap: 5px;
}

.integration-card .form-row.compact {
  gap: 9px;
}

.integration-card .ghost-btn.compact {
  width: 100%;
  min-height: 42px;
}

.integration-action-line {
  display: grid;
  align-content: end;
}

.integration-footer {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  padding-top: 0;
}

.integration-footer .ghost-btn {
  width: 100%;
  min-width: 168px;
}

.integration-footer .settings-helper {
  flex: 1;
}

.writer-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

.writer-template-box {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 151, 167, 0.14);
  border-radius: 14px;
  background: rgba(247, 252, 253, 0.72);
}

.draft-subject-label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.email-style-toolbar {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  padding: 13px;
  border: 1px solid rgba(0, 151, 167, 0.16);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(234, 249, 252, 0.82), rgba(255, 255, 255, 0.92));
}

.email-style-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.email-style-head strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.35;
}

.email-style-head span {
  flex: 0 0 auto;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(0, 151, 167, 0.2);
  border-radius: 999px;
  padding: 0 10px;
  color: #087a86;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 800;
}

.email-style-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.7fr 0.7fr 1fr;
  gap: 9px;
  align-items: end;
}

.email-style-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.email-style-grid select,
.email-style-grid input[type="color"] {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(25, 39, 52, 0.14);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.email-style-grid input[type="color"] {
  padding: 4px;
  cursor: pointer;
}

.email-style-toggle {
  min-height: 38px;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border: 1px solid rgba(25, 39, 52, 0.12);
  border-radius: 10px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.82);
}

.email-style-toggle input {
  width: 18px;
  height: 18px;
}

.email-style-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.email-style-actions .compact {
  min-height: 40px;
}

.help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.36fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
  overflow: hidden;
}

.help-hero h3 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2.1vw, 2.45rem);
}

.help-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.help-search-card {
  border: 1px solid rgba(0, 151, 167, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 151, 167, 0.12), rgba(47, 113, 255, 0.09)),
    rgba(255, 255, 255, 0.78);
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.help-search-card span,
.help-search-card small {
  color: var(--muted);
}

.help-search-card strong {
  font-size: 1.08rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.help-section {
  min-height: 100%;
}

.help-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  counter-reset: helpStep;
}

.help-steps li {
  position: relative;
  min-height: 64px;
  padding: 12px 12px 12px 54px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
}

.help-steps li::before {
  counter-increment: helpStep;
  content: counter(helpStep);
  position: absolute;
  left: 12px;
  top: 13px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.help-steps strong,
.help-card-list strong,
.help-mini-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 5px;
}

.help-steps span,
.help-card-list span,
.help-mini-card span,
.help-faq-item p {
  color: var(--muted);
  line-height: 1.55;
}

.help-card-list {
  display: grid;
  gap: 10px;
}

.help-card-list > div,
.help-mini-card,
.help-faq-item {
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  padding: 13px;
}

.help-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.help-faq-list {
  display: grid;
  gap: 10px;
}

.help-faq-item summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--text);
}

.help-faq-item p {
  margin: 10px 0 0;
}

.nav-btn.has-badge {
  grid-template-columns: 28px minmax(0, 1fr) auto;
}

.nav-new-badge {
  justify-self: end;
  min-width: 34px;
  padding: 2px 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff4d6d, #ff9f1c);
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0;
}

.announcement-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.32fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 14px;
  overflow: hidden;
}

.announcement-hero h3 {
  margin-bottom: 8px;
  font-size: clamp(1.65rem, 2vw, 2.3rem);
}

.announcement-hero p {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.7;
}

.announcement-summary {
  border: 1px solid rgba(47, 113, 255, 0.16);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 113, 255, 0.1), rgba(0, 151, 167, 0.12)),
    rgba(255, 255, 255, 0.78);
  padding: 18px;
  display: grid;
  align-content: center;
  gap: 7px;
}

.announcement-summary span,
.announcement-summary small {
  color: var(--muted);
}

.announcement-summary strong {
  font-size: 1.18rem;
}

.announcement-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
  gap: 14px;
  align-items: start;
}

.announcement-timeline {
  display: grid;
  gap: 12px;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
}

.announcement-timeline::-webkit-scrollbar {
  width: 8px;
}

.announcement-timeline::-webkit-scrollbar-track {
  background: rgba(226, 235, 244, 0.7);
  border-radius: 999px;
}

.announcement-timeline::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 166, 196, 0.85), rgba(52, 107, 245, 0.75));
  border-radius: 999px;
}

.announcement-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 13px;
  padding: 14px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.75);
}

.announcement-date {
  min-height: 66px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  align-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.announcement-date strong {
  font-size: 1.02rem;
}

.announcement-date span {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.86;
}

.announcement-content {
  display: grid;
  gap: 8px;
}

.announcement-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.announcement-title-row h4 {
  margin: 0;
  font-size: 1.02rem;
}

.announcement-content p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.announcement-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.announcement-tag.fix {
  color: #dc2626;
  background: rgba(248, 113, 113, 0.12);
}

.announcement-tag.feature {
  color: #0f766e;
  background: rgba(45, 212, 191, 0.14);
}

.announcement-tag.improve {
  color: #1d4ed8;
  background: rgba(96, 165, 250, 0.16);
}

.announcement-tag.notice {
  color: #a16207;
  background: rgba(245, 158, 11, 0.14);
}

.announcement-rule-list {
  display: grid;
  gap: 10px;
}

.announcement-rule-list > div {
  padding: 12px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
}

.announcement-rule-list strong {
  display: block;
  margin-bottom: 4px;
}

.announcement-rule-list span {
  color: var(--muted);
  line-height: 1.55;
}

.ai-model-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.ai-model-picker .compact {
  min-height: 52px;
  white-space: nowrap;
}

#aiBaseUrlInput[readonly] {
  color: var(--muted);
  background: rgba(245, 248, 250, 0.78);
}

#aiModelStatus[data-type="success"] {
  color: #0f9f65;
}

#aiModelStatus[data-type="error"] {
  color: #f45f72;
}

#aiModelStatus[data-type="muted"] {
  color: var(--muted);
}

#mailboxStatus[data-type="success"] {
  color: #0f9f65;
}

#mailboxStatus[data-type="error"] {
  color: #f45f72;
}

#snovioStatus[data-type="success"] {
  color: #0f9f65;
}

#snovioStatus[data-type="error"] {
  color: #f45f72;
  font-weight: 800;
}

#mailAutomationHelper[data-type="error"] {
  color: #f45f72;
  font-weight: 800;
}

.mailbox-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.source-note {
  min-height: 72px;
  padding: 12px;
  border: 1px solid rgba(72, 216, 223, 0.18);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.42);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.free-source-box,
.free-test-import {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.15);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.38);
}

.local-smart-engine-box {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(72, 216, 223, 0.22);
  border-radius: var(--radius);
  background: rgba(72, 216, 223, 0.07);
}

.local-smart-engine-box[hidden] {
  display: none;
}

.local-smart-engine-box strong {
  color: var(--text);
  font-size: 0.92rem;
}

.local-smart-engine-box small,
.local-smart-engine-box span {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.free-source-box strong {
  color: var(--text);
  font-size: 0.92rem;
}

.free-source-box small,
.free-test-import span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.free-source-grid,
.source-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.free-source-grid span,
.source-channel-grid label {
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(72, 216, 223, 0.16);
  background: rgba(72, 216, 223, 0.06);
  color: var(--cyan);
  font-size: 0.8rem;
}

.source-channel-grid input {
  width: 14px;
  height: 14px;
  accent-color: var(--cyan);
}

.source-validation-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.35fr) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(142, 165, 151, 0.16);
}

.source-validation-row label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid rgba(233, 190, 106, 0.24);
  border-radius: 8px;
  color: var(--text);
  background: rgba(233, 190, 106, 0.08);
}

.source-validation-row input {
  width: 14px;
  height: 14px;
  accent-color: var(--gold);
}

.free-source-box[data-custom-channels="true"]::before {
  content: "自定义渠道";
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: #8a5a08;
  background: rgba(233, 190, 106, 0.14);
  font-size: 0.74rem;
  font-weight: 700;
}

.cost-preview {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(233, 190, 106, 0.25);
  border-radius: var(--radius);
  background: rgba(233, 190, 106, 0.08);
}

.cost-preview strong {
  color: var(--text);
  font-size: 0.92rem;
}

.cost-preview span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.search-logic-panel {
  margin-top: 14px;
}

.logic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.logic-step {
  display: grid;
  gap: 8px;
  min-height: 154px;
  padding: 14px;
  border: 1px solid rgba(142, 165, 151, 0.14);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.4);
}

.logic-step span {
  width: 34px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(72, 216, 223, 0.12);
  color: var(--cyan);
  font-size: 0.75rem;
  font-weight: 800;
}

.logic-step strong {
  color: var(--text);
  font-size: 0.98rem;
}

.logic-step p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.logic-step.paid-step {
  border-color: rgba(233, 190, 106, 0.28);
  background: rgba(233, 190, 106, 0.07);
}

.logic-step.paid-step span {
  background: rgba(233, 190, 106, 0.13);
  color: var(--amber);
}

.keyword-engine-panel {
  margin-bottom: 14px;
}

.keyword-engine-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.55fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: stretch;
}

.keyword-output {
  min-height: 300px;
  max-height: 560px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(142, 165, 151, 0.14);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.42);
  padding: 14px;
}

.keyword-output:has(.empty-compact) {
  height: 100%;
  max-height: none;
  display: flex;
}

.keyword-output:has(.empty-compact) .empty-compact {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 100%;
}

.keyword-engine-grid > .settings-form {
  align-self: start;
}

.keyword-pack {
  display: grid;
  gap: 13px;
}

.keyword-pack-head {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.keyword-pack-head > div,
.keyword-section {
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.52);
  padding: 12px;
}

.keyword-pack-head span,
.keyword-section p {
  color: var(--muted);
}

.keyword-section {
  display: grid;
  gap: 8px;
}

.keyword-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.keyword-section-head > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.keyword-section p {
  margin: 0;
}

.keyword-section code {
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--amber);
}

.compact-keyword-section {
  padding: 10px 12px;
}

.featured-keyword-section {
  border-color: rgba(0, 151, 167, 0.18);
  background:
    linear-gradient(135deg, rgba(232, 249, 252, 0.9), rgba(238, 244, 255, 0.86)),
    rgba(255, 255, 255, 0.72);
}

.featured-keyword-row {
  max-height: 126px;
  overflow: hidden;
}

.keyword-template-list {
  display: grid;
  gap: 7px;
}

.keyword-details {
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.keyword-details summary {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: #244057;
  cursor: pointer;
  font-weight: 850;
}

.keyword-details[open] summary {
  border-bottom: 1px solid rgba(25, 39, 52, 0.08);
}

.keyword-details .keyword-matrix {
  padding: 12px;
}

.keyword-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-chip {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(72, 216, 223, 0.24);
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(72, 216, 223, 0.06);
  font-size: 0.82rem;
  line-height: 1.25;
  text-align: center;
}

.keyword-chip.muted {
  border-color: rgba(142, 165, 151, 0.18);
  color: var(--muted);
  background: rgba(142, 165, 151, 0.07);
}

.keyword-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.keyword-matrix > div {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(142, 165, 151, 0.12);
  border-radius: var(--radius);
  background: rgba(3, 6, 5, 0.24);
}

.keyword-matrix > div > span {
  color: var(--muted);
  font-size: 0.8rem;
}

.category-select-list {
  display: grid;
  gap: 8px;
}

.category-option {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(4, 7, 6, 0.38);
  color: var(--text);
}

.category-option input {
  width: 16px;
  height: 16px;
  margin-top: 3px;
}

.category-option strong,
.category-option small {
  display: block;
}

.category-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.toolbar-wrap {
  align-items: center;
}

.toolbar {
  justify-content: flex-end;
}

.lead-toolbar-helper {
  flex-basis: 100%;
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
  text-align: right;
}

.toolbar input {
  min-width: min(320px, 100%);
}

.toolbar-select {
  min-height: 38px;
  min-width: 128px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(142, 165, 151, 0.2);
  border-radius: 10px;
  background-color: rgba(7, 10, 9, 0.38);
  color: var(--text);
}

.lead-column-menu-wrap {
  position: relative;
  display: inline-flex;
}

.lead-column-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 30;
  width: min(420px, calc(100vw - 36px));
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(72, 216, 223, 0.24);
  border-radius: 14px;
  background: rgba(7, 14, 18, 0.96);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
}

.lead-column-menu[hidden] {
  display: none;
}

.lead-column-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lead-column-menu-head strong {
  color: var(--text);
  font-size: 0.96rem;
}

.lead-column-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.lead-column-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(142, 165, 151, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.2;
  cursor: pointer;
}

.lead-column-option:hover {
  border-color: rgba(72, 216, 223, 0.28);
  background: rgba(72, 216, 223, 0.08);
}

.lead-column-option input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  flex: 0 0 17px;
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
  margin: 0;
  padding: 0;
  border-radius: 4px;
  box-shadow: none;
  accent-color: #00a6c4;
}

.lead-column-option-name {
  flex: 1;
  min-width: 0;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead-column-option-badge {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(72, 216, 223, 0.1);
  color: var(--cyan);
  font-size: 0.72rem;
  font-weight: 800;
}

.lead-column-menu p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(142, 165, 151, 0.14);
  border-radius: var(--radius);
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 0.84rem;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagination-controls label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.pagination-controls select {
  width: 76px;
  min-height: 34px;
}

.pagination-controls button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

table {
  width: 100%;
  min-width: var(--lead-table-min-width, 980px);
  table-layout: fixed;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(142, 165, 151, 0.12);
  vertical-align: middle;
}

.table-wrap th:nth-child(1),
.table-wrap td:nth-child(1) {
  width: 52px;
}

.table-wrap th:nth-child(2),
.table-wrap td:nth-child(2) {
  width: 300px;
}

.table-wrap th:nth-child(3),
.table-wrap td:nth-child(3) {
  width: 178px;
}

.table-wrap th:nth-child(4),
.table-wrap td:nth-child(4) {
  width: 118px;
}

.table-wrap th:nth-child(5),
.table-wrap td:nth-child(5) {
  width: 118px;
}

.table-wrap th:nth-child(6),
.table-wrap td:nth-child(6) {
  width: 270px;
}

.table-wrap th:nth-child(7),
.table-wrap td:nth-child(7) {
  width: 80px;
  text-align: center;
}

.table-wrap th:nth-child(8),
.table-wrap td:nth-child(8) {
  width: 130px;
}

.table-wrap th:nth-child(9),
.table-wrap td:nth-child(9) {
  width: 100px;
}

.table-wrap th:nth-child(10),
.table-wrap td:nth-child(10) {
  width: 132px;
}

.table-wrap th:nth-child(11),
.table-wrap td:nth-child(11) {
  width: 158px;
}

.table-wrap th:nth-child(12),
.table-wrap td:nth-child(12) {
  width: 170px;
}

.table-wrap th:nth-child(13),
.table-wrap td:nth-child(13) {
  width: 96px;
}

.table-wrap td:nth-child(4),
.table-wrap td:nth-child(5),
.table-wrap td:nth-child(7),
.table-wrap td:nth-child(8),
.table-wrap td:nth-child(9),
.table-wrap td:nth-child(10),
.table-wrap td:nth-child(11),
.table-wrap td:nth-child(12),
.table-wrap td:nth-child(13) {
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  background: rgba(3, 6, 5, 0.44);
}

.th-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.th-filter select {
  width: 26px;
  min-width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(142, 165, 151, 0.18);
  border-radius: 7px;
  background-color: rgba(7, 10, 9, 0.28);
  color: var(--muted);
  font-size: 0;
  cursor: pointer;
}

.th-filter select:focus {
  border-color: rgba(72, 216, 223, 0.45);
  box-shadow: 0 0 0 2px rgba(72, 216, 223, 0.12);
}

.th-filter select option {
  color: #101815;
  font-size: 0.88rem;
}

td {
  color: #dce9df;
  font-size: 0.92rem;
}

tbody tr {
  transition: background 0.16s ease;
}

.lead-mark-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 192px;
  white-space: nowrap;
}

.lead-star-btn,
.lead-note-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid rgba(142, 165, 151, 0.2);
  background: rgba(7, 10, 9, 0.28);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.lead-star-btn.is-active {
  border-color: rgba(246, 176, 57, 0.65);
  background: rgba(246, 176, 57, 0.14);
  color: #f4a51c;
}

.lead-note-btn.has-note {
  border-color: rgba(0, 166, 196, 0.36);
  background: rgba(0, 166, 196, 0.12);
  color: var(--cyan);
}

.lead-label-select {
  width: 128px;
  min-height: 30px;
  padding: 0 22px 0 8px;
  border: 1px solid rgba(142, 165, 151, 0.2);
  border-radius: 9px;
  background-color: rgba(7, 10, 9, 0.28);
  color: var(--text);
  font-size: 0.78rem;
}

.lead-mark-pill {
  border-color: rgba(0, 166, 196, 0.3);
  color: var(--cyan);
}

.lead-mark-pill.important {
  border-color: rgba(246, 176, 57, 0.42);
  background: rgba(246, 176, 57, 0.12);
  color: #f4a51c;
}

tbody tr:hover {
  background: rgba(72, 216, 223, 0.06);
}

.table-company {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.table-company strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-company span {
  color: var(--dim);
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  min-height: 520px;
}

.empty-state {
  min-height: 460px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--text);
  font-size: 1.3rem;
}

.detail-empty-state {
  min-height: 520px;
  display: block;
  text-align: left;
}

.detail-empty-shell {
  display: grid;
  gap: 14px;
}

.detail-empty-hero {
  min-height: 142px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(72, 216, 223, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(72, 216, 223, 0.12), transparent 44%),
    rgba(7, 10, 9, 0.46);
}

.detail-empty-hero h3 {
  margin: 4px 0 6px;
  font-size: clamp(1.35rem, 2.4vw, 2.05rem);
}

.detail-empty-hero span,
.detail-empty-fallback span,
.detail-empty-lead small {
  color: var(--muted);
}

.detail-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.detail-empty-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-empty-stat {
  min-height: 86px;
  padding: 14px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.44);
}

.detail-empty-stat span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.detail-empty-stat strong {
  color: var(--text);
  font-size: 1.65rem;
  line-height: 1;
}

.detail-empty-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(340px, 1.05fr);
  gap: 14px;
}

.detail-empty-section {
  min-height: 260px;
}

.detail-empty-leads,
.detail-preview-grid {
  display: grid;
  gap: 10px;
}

.detail-preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-empty-lead {
  width: 100%;
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.17);
  border-radius: var(--radius);
  background: rgba(4, 8, 7, 0.48);
  color: var(--text);
  text-align: left;
}

.detail-empty-lead:hover {
  border-color: rgba(72, 216, 223, 0.46);
  background: rgba(72, 216, 223, 0.07);
}

.detail-empty-lead strong,
.detail-empty-lead small {
  display: block;
}

.detail-empty-lead small {
  margin-top: 5px;
  font-size: 0.82rem;
}

.detail-empty-lead em {
  min-width: 42px;
  min-height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(72, 216, 223, 0.28);
  border-radius: var(--radius);
  color: var(--cyan);
  font-style: normal;
  font-weight: 850;
}

.detail-empty-fallback {
  min-height: 174px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px dashed rgba(142, 165, 151, 0.24);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.3);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(340px, 1.2fr);
  gap: 18px;
}

.detail-cockpit {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 14px;
}

.detail-cockpit .span-2 {
  grid-column: span 2;
}

.detail-hero-card {
  grid-column: span 2;
  min-height: 188px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid rgba(0, 151, 167, 0.2);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 151, 167, 0.12), transparent 42%),
    linear-gradient(100deg, rgba(53, 109, 255, 0.1), rgba(255, 255, 255, 0.82));
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.detail-hero-card::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 38%;
  height: 100%;
  background:
    linear-gradient(115deg, transparent 0 48%, rgba(0, 151, 167, 0.1) 48% 58%, transparent 58%),
    linear-gradient(135deg, transparent 0 68%, rgba(231, 151, 34, 0.12) 68% 76%, transparent 76%);
  pointer-events: none;
}

.detail-hero-card h3 {
  margin: 4px 0 8px;
  font-size: clamp(2.15rem, 4vw, 4rem);
  line-height: 1;
}

.detail-hero-card span {
  display: block;
  color: var(--muted);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.detail-hero-score {
  width: 148px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 50%;
  color: #ffffff;
  background:
    radial-gradient(circle at center, rgba(16, 29, 40, 0.92) 0 54%, transparent 55%),
    conic-gradient(var(--green), var(--cyan), var(--blue), var(--amber), var(--green));
  box-shadow: 0 20px 44px rgba(53, 109, 255, 0.18);
  position: relative;
  z-index: 1;
}

.detail-hero-score span,
.detail-hero-score small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.76rem;
}

.detail-hero-score strong {
  color: #ffffff;
  font-size: 2.8rem;
  line-height: 1;
}

.detail-profile-card {
  display: grid;
  gap: 14px;
}

.profile-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.profile-source-btn {
  display: inline-grid;
  place-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(53, 109, 255, 0.24);
  border-radius: var(--radius);
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.profile-source-btn.muted {
  color: var(--muted);
  border-color: rgba(25, 39, 52, 0.12);
  background: rgba(244, 247, 250, 0.9);
}

.company-summary {
  margin: 0;
  color: #243646;
  font-size: 1.02rem;
  line-height: 1.78;
}

.profile-signal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-signal {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(244, 248, 252, 0.82);
}

.profile-signal span,
.profile-source-note {
  color: var(--muted);
}

.profile-signal strong {
  color: #101d28;
  font-size: 1.05rem;
}

.profile-highlight-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.profile-highlight-list span {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(0, 151, 167, 0.18);
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(232, 249, 252, 0.8);
  font-size: 0.82rem;
  font-weight: 760;
}

.profile-match-list {
  display: grid;
  gap: 10px;
}

.profile-match-list > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: var(--radius);
  background: rgba(244, 248, 252, 0.74);
}

.profile-match-list strong,
.profile-match-list span {
  display: block;
}

.profile-match-list span {
  color: var(--muted);
  line-height: 1.5;
}

.compact-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.detail-identity {
  display: grid;
  gap: 14px;
}

.identity-block {
  padding: 16px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.44);
}

.identity-block span {
  color: var(--muted);
}

.score-ring {
  width: 156px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  margin: 8px auto;
  background:
    radial-gradient(circle at center, rgba(8, 10, 9, 0.96) 58%, transparent 59%),
    conic-gradient(var(--green) var(--score-angle), rgba(142, 165, 151, 0.16) 0);
}

.score-ring strong {
  font-size: 2.2rem;
}

.small-ring {
  width: 118px;
}

.small-ring strong {
  font-size: 1.8rem;
}

.detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.contact-list {
  display: grid;
  gap: 10px;
}

.evidence-list {
  display: grid;
  gap: 12px;
}

.evidence-group {
  display: grid;
  gap: 6px;
}

.evidence-group strong {
  color: var(--text);
  font-size: 0.88rem;
}

.evidence-warning {
  color: var(--amber) !important;
}

.evidence-list a,
.evidence-list span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.evidence-list a {
  color: var(--cyan);
  text-decoration: none;
}

.evidence-copy-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.copy-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 9px;
  border: 1px solid rgba(0, 158, 181, 0.22);
  border-radius: 999px;
  background: rgba(0, 158, 181, 0.08);
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.copy-mini-btn:hover {
  background: rgba(0, 158, 181, 0.14);
  border-color: rgba(0, 158, 181, 0.38);
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.44);
}

.contact-card strong,
.contact-card span,
.contact-card small {
  display: block;
}

.contact-profile-link {
  display: inline-block;
  margin-top: 7px;
  color: var(--cyan);
  font-size: 0.82rem;
  text-decoration: none;
}

.contact-card span,
.contact-card small {
  color: var(--muted);
  margin-top: 4px;
}

.contact-card-meta {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.field-box {
  min-height: 78px;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.44);
}

.field-box span {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}

.tag-row,
.feature-row,
.status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag,
.feature {
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(246, 198, 95, 0.26);
  color: var(--amber);
  border-radius: var(--radius);
  font-size: 0.82rem;
}

.draft-box {
  min-height: 420px;
  resize: vertical;
  line-height: 1.55;
}

.settings-note {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(142, 165, 151, 0.16);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.42);
}

.settings-note span {
  color: var(--muted);
}

.license-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

#licenseView .license-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#licenseView .settings-grid {
  align-items: start;
}

#licenseView .settings-grid > .panel:first-child {
  grid-column: 1;
  grid-row: 1;
}

#licenseView .settings-grid > .billing-panel {
  grid-column: 2;
  grid-row: 1 / span 2;
}

#licenseView .settings-grid > .panel:nth-child(3) {
  grid-column: 1;
  grid-row: 2;
}

.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.billing-plan-card {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 15px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}

.billing-plan-card.active {
  border-color: rgba(47, 123, 255, 0.46);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.12), rgba(34, 185, 129, 0.08));
}

.billing-plan-card span,
.billing-plan-card small,
.billing-order-item span,
.billing-order-item small {
  color: var(--muted);
}

.billing-plan-card strong {
  font-size: 1.45rem;
}

.billing-payment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(47, 123, 255, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.08), rgba(20, 184, 166, 0.06));
}

.billing-payment-card[hidden] {
  display: none;
}

.billing-payment-card span,
.billing-payment-card small {
  display: block;
}

.billing-payment-card span {
  font-weight: 800;
  color: var(--text);
}

.billing-payment-card small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.5;
}

.billing-payment-card img {
  width: 132px;
  height: 132px;
  padding: 7px;
  object-fit: contain;
  border: 1px solid rgba(31, 81, 111, 0.12);
  border-radius: 8px;
  background: #fff;
}

.billing-order-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.billing-order-hint {
  padding: 11px 12px;
  border: 1px solid rgba(245, 159, 56, 0.26);
  border-radius: 8px;
  background: rgba(245, 159, 56, 0.07);
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.billing-order-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.billing-order-item.pending {
  border-color: rgba(245, 159, 56, 0.28);
  background: rgba(245, 159, 56, 0.07);
}

.billing-order-preview {
  border-color: rgba(47, 123, 255, 0.28);
  background: linear-gradient(135deg, rgba(47, 123, 255, 0.09), rgba(20, 184, 166, 0.06));
}

.billing-order-item strong,
.billing-order-item span,
.billing-order-item small {
  display: block;
}

.billing-order-item span,
.billing-order-item small {
  margin-top: 4px;
}

.license-stat {
  padding: 15px;
}

.license-stat strong {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
}

.license-code-view {
  margin-top: 16px;
}

.license-code-view textarea {
  min-height: 86px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@keyframes scan {
  to {
    transform: translateY(540%);
  }
}

@keyframes rotate {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(118, 224, 160, 0.55);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(118, 224, 160, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(118, 224, 160, 0);
  }
}

@media (max-width: 1100px) {
  .activation-screen,
  .workspace,
  .split-grid,
  .settings-grid,
  .detail-cockpit,
  .detail-grid,
  .detail-empty-grid,
  .radar-board,
  .automation-grid,
  .keyword-engine-grid,
  .integration-grid,
  .logic-grid,
  .keyword-matrix {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 4;
  }

  .nav-list {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    overflow-x: auto;
  }

  .dashboard-grid,
  .kpi-grid,
  .license-grid,
  .detail-empty-stats,
  .automation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2,
  .span-3 {
    grid-column: auto;
  }

  #licenseView .settings-grid > .panel:first-child,
  #licenseView .settings-grid > .billing-panel,
  #licenseView .settings-grid > .panel:nth-child(3) {
    grid-column: auto;
    grid-row: auto;
  }

  .integration-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .integration-footer .ghost-btn {
    width: 100%;
  }

  .seller-profile-panel,
  .mail-signature-panel {
    grid-column: 1 / -1;
  }

  #mailAutomationView .seller-profile-form,
  #mailAutomationView .mail-signature-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #mailAutomationView .seller-profile-form .seller-wide,
  .seller-save-row,
  #mailAutomationView .mail-signature-form .signature-wide,
  #mailAutomationView .mail-signature-form .signature-custom,
  .signature-save-row {
    grid-column: 1 / -1;
  }

  .detail-cockpit .span-2,
  .detail-hero-card {
    grid-column: auto;
  }

  .profile-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .activation-screen,
  .main {
    padding: 16px;
  }

  .activation-visual {
    min-height: 360px;
  }

  .topbar,
  .panel-header,
  .detail-hero-card,
  .detail-empty-hero,
  .task-item,
  .mission-item,
  .mail-queue-item,
  .contact-card {
    display: grid;
    grid-template-columns: 1fr;
  }

  .topbar-tools,
  .toolbar,
  .detail-empty-actions {
    justify-content: stretch;
  }

  .topbar-tools > *,
  .toolbar > *,
  .activation-actions > *,
  .data-actions > *,
  .automation-actions > * {
    flex: 1 1 160px;
  }

  .kpi-grid,
  .dashboard-grid,
  .license-grid,
  .detail-fields,
  .compact-fields,
  .profile-signal-grid,
  .detail-empty-stats,
  .detail-preview-grid,
  .form-row,
  .task-core-grid,
  .task-advanced-grid,
  .automation-grid,
  .keyword-pack-head {
    grid-template-columns: 1fr;
  }

  .task-keyword-field,
  .task-core-grid .market-field,
  .task-advanced-wide {
    grid-column: auto;
  }

  #mailAutomationView .mail-signature-form {
    grid-template-columns: 1fr;
  }

  .profile-title-row {
    display: grid;
  }

  .detail-hero-score {
    width: 118px;
    justify-self: start;
  }

  .detail-hero-card h3 {
    font-size: 2rem;
  }

  .workspace {
    display: block;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

/* Premium light cockpit redesign */
:root {
  --bg: #f6f8fc;
  --bg-2: #eef4f9;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: rgba(255, 255, 255, 0.98);
  --panel-soft: rgba(244, 249, 252, 0.92);
  --line: rgba(25, 39, 52, 0.12);
  --line-strong: rgba(0, 151, 167, 0.28);
  --text: #14212b;
  --muted: #627181;
  --dim: #8b98a8;
  --cyan: #0097a7;
  --green: #16a36a;
  --amber: #e79722;
  --rose: #e85757;
  --blue: #356dff;
  --violet: #7457d9;
  --ink: #0f1b24;
  --shadow: 0 18px 44px rgba(22, 42, 64, 0.11);
  --radius: 8px;
}

body {
  color: var(--text);
  background:
    linear-gradient(rgba(28, 58, 82, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 58, 82, 0.045) 1px, transparent 1px),
    linear-gradient(116deg, rgba(0, 151, 167, 0.1) 0 18%, transparent 18% 100%),
    linear-gradient(154deg, transparent 0 59%, rgba(231, 151, 34, 0.1) 59% 74%, transparent 74%),
    linear-gradient(180deg, #fbfcff 0%, #f4f8fb 45%, #edf3f8 100%);
  background-size:
    36px 36px,
    36px 36px,
    auto,
    auto,
    auto;
}

.app-frame {
  overflow: auto;
}

.app-frame::before {
  background:
    linear-gradient(100deg, transparent 0 8%, rgba(53, 109, 255, 0.07) 8% 12%, transparent 12% 100%),
    linear-gradient(128deg, transparent 0 76%, rgba(0, 151, 167, 0.09) 76% 81%, transparent 81% 100%);
  opacity: 1;
}

.workspace {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  margin: 16px 0 16px 16px;
  min-height: calc(100vh - 32px);
  border: 1px solid rgba(28, 58, 82, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(247, 251, 253, 0.88)),
    linear-gradient(120deg, rgba(0, 151, 167, 0.08), transparent 42%);
  box-shadow: 0 18px 45px rgba(26, 49, 70, 0.1);
  backdrop-filter: blur(18px);
}

.sidebar-brand {
  min-height: 72px;
  padding: 10px 8px 18px;
  border-bottom: 1px solid rgba(25, 39, 52, 0.08);
}

.sidebar-brand strong {
  color: #102331;
  font-weight: 900;
}

.sidebar-brand span {
  display: inline-grid;
  place-items: center;
  margin-top: 5px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  font-size: 0.7rem;
}

.brand-mark {
  color: #ffffff;
  border: 0;
  background:
    linear-gradient(145deg, #0aa6b5, #356dff 58%, #7457d9);
  box-shadow: 0 12px 26px rgba(53, 109, 255, 0.22);
}

.nav-list {
  gap: 6px;
}

.nav-btn {
  min-height: 46px;
  grid-template-columns: 32px 1fr;
  color: #5d6f7e;
  border: 1px solid transparent;
  background: transparent;
  font-weight: 760;
}

.nav-btn span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: var(--cyan);
  background: rgba(0, 151, 167, 0.09);
}

.nav-btn.active,
.nav-btn:hover {
  color: #102331;
  border-color: rgba(0, 151, 167, 0.18);
  background: linear-gradient(90deg, rgba(0, 151, 167, 0.12), rgba(255, 255, 255, 0.64));
}

.nav-btn.active span {
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.sidebar-status {
  border-color: rgba(22, 163, 106, 0.2);
  background: linear-gradient(135deg, rgba(22, 163, 106, 0.1), rgba(255, 255, 255, 0.76));
}

.sidebar-status strong {
  color: #143126;
}

.main {
  padding: 16px 28px 32px;
}

.route-shell {
  position: sticky;
  top: 0;
  z-index: 6;
  margin-bottom: 10px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 8px;
  background: rgba(248, 252, 255, 0.88);
  box-shadow: 0 14px 34px rgba(24, 47, 70, 0.07);
  backdrop-filter: blur(18px);
  overflow: visible;
}

.route-nav,
.route-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 14px;
}

.route-nav {
  border-bottom: 1px solid rgba(25, 39, 52, 0.08);
}

.route-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-brand,
.route-group-btn,
.route-menu button,
.route-tab {
  border: 1px solid transparent;
  background: transparent;
  color: #526678;
  font-weight: 820;
  letter-spacing: 0;
  cursor: pointer;
}

.route-brand,
.route-group-btn {
  min-height: 34px;
  padding: 0 13px;
  border-radius: 8px;
}

.route-brand {
  color: #102331;
  background: linear-gradient(135deg, rgba(0, 151, 167, 0.12), rgba(53, 109, 255, 0.09));
}

.route-brand.active,
.route-group.active .route-group-btn,
.route-group-btn:hover {
  color: #102331;
  border-color: rgba(0, 151, 167, 0.18);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 -2px 0 rgba(0, 151, 167, 0.38);
}

.route-group {
  position: relative;
}

.route-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.route-group-btn small {
  color: var(--cyan);
  font-size: 0.8rem;
}

.route-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  display: none;
  padding: 8px;
  border: 1px solid rgba(25, 39, 52, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(19, 36, 54, 0.15);
}

.route-group:hover .route-menu,
.route-group:focus-within .route-menu {
  display: grid;
  gap: 5px;
}

.route-menu button {
  width: 100%;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  text-align: left;
}

.route-menu button:hover,
.route-menu button.active {
  color: var(--cyan);
  background: rgba(0, 151, 167, 0.08);
}

.route-tabs {
  min-height: 44px;
  flex-wrap: wrap;
  padding-top: 7px;
  padding-bottom: 7px;
}

.route-tab {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-color: rgba(25, 39, 52, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.route-tab.active {
  color: #102331;
  border-color: rgba(0, 151, 167, 0.28);
  background: rgba(0, 151, 167, 0.09);
}

.route-tab small {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #7b8794;
}

.route-tab small:hover {
  color: #ffffff;
  background: var(--rose);
}

.route-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  color: #6f7f8d;
  font-size: 0.78rem;
  font-weight: 760;
}

.route-breadcrumbs em {
  color: #a4afba;
  font-style: normal;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(25, 39, 52, 0.12);
  border-radius: 8px;
  color: #1d3140;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 10px 22px rgba(24, 47, 70, 0.08);
  cursor: pointer;
}

.theme-toggle-btn:hover,
.theme-toggle-btn.is-dark {
  color: #ffffff;
  border-color: rgba(0, 151, 167, 0.34);
  background: linear-gradient(135deg, #111827, #0b1724);
}

.theme-toggle-btn span {
  font-size: 1.05rem;
  line-height: 1;
}

.topbar {
  position: sticky;
  top: 112px;
  z-index: 3;
  min-height: 92px;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(25, 39, 52, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 18px 38px rgba(24, 47, 70, 0.08);
  backdrop-filter: blur(20px);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber), var(--rose));
}

.eyebrow {
  color: var(--cyan);
  letter-spacing: 0;
}

h1,
h2,
h3 {
  color: #101d28;
}

.topbar h2 {
  margin-top: 3px;
  font-size: clamp(1.75rem, 2.4vw, 2.65rem);
  font-weight: 920;
}

.topbar-tools {
  justify-content: flex-end;
}

.mini-stat {
  border-color: rgba(25, 39, 52, 0.1);
  background: #f4f8fb;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.mini-stat strong {
  color: var(--blue);
}

textarea,
input,
select {
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(25, 39, 52, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

textarea:focus,
input:focus,
select:focus {
  border-color: rgba(0, 151, 167, 0.58);
  box-shadow: 0 0 0 4px rgba(0, 151, 167, 0.12);
}

select {
  color-scheme: light;
}

label,
.settings-helper,
.status-message,
.device-strip span,
.metric-panel span,
.metric-panel small,
.license-stat span,
.radar-item span,
.priority-item span,
.task-item span,
.mission-item span,
.pipeline-item span,
.funnel-item span,
.insight-item span,
.alert-item span,
.tracking-meter span,
.tracking-meter small,
.pixel-code-box span,
.open-event span,
.automation-stat span,
.free-source-box small,
.free-test-import span,
.cost-preview span,
.logic-step p,
.keyword-pack-head span,
.keyword-section p,
.category-option small,
.table-company span,
.empty-state,
.detail-empty-hero span,
.detail-empty-fallback span,
.detail-empty-lead small,
.identity-block span,
.contact-card span,
.contact-card small,
.field-box span,
.settings-note span {
  color: var(--muted);
}

.primary-btn,
.ghost-btn,
.icon-btn {
  border-radius: 8px;
  font-weight: 820;
  box-shadow: 0 10px 22px rgba(24, 47, 70, 0.08);
}

.primary-btn {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, #0097a7, #356dff 62%, #7457d9);
}

.ghost-btn {
  color: #1d3140;
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(25, 39, 52, 0.13);
}

.ghost-btn.danger {
  color: #b83232;
  border-color: rgba(232, 87, 87, 0.26);
  background: rgba(255, 245, 245, 0.92);
}

.icon-btn {
  color: var(--cyan);
  background: #ffffff;
  border-color: rgba(0, 151, 167, 0.2);
}

.primary-btn:hover,
.ghost-btn:hover,
.icon-btn:hover {
  border-color: rgba(0, 151, 167, 0.42);
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(24, 47, 70, 0.12);
}

.kpi-grid {
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 12px;
}

.metric-panel,
.panel,
.license-stat {
  border-color: rgba(25, 39, 52, 0.11);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-panel {
  min-height: 132px;
  padding: 17px 15px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 253, 0.86)),
    linear-gradient(90deg, rgba(0, 151, 167, 0.08), transparent);
}

.metric-panel::after {
  top: 0;
  bottom: auto;
  height: 4px;
  background: var(--card-accent, var(--cyan));
}

.metric-panel:nth-child(1) {
  --card-accent: var(--cyan);
}

.metric-panel:nth-child(2) {
  --card-accent: var(--green);
}

.metric-panel:nth-child(3) {
  --card-accent: var(--blue);
}

.metric-panel:nth-child(4) {
  --card-accent: var(--amber);
}

.metric-panel:nth-child(5) {
  --card-accent: var(--violet);
}

.metric-panel:nth-child(6) {
  --card-accent: var(--rose);
}

.metric-panel:nth-child(7) {
  --card-accent: #0f9f8f;
}

.metric-panel strong {
  color: #101d28;
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 930;
}

.accent-cyan::after {
  background: var(--cyan);
}

.accent-green::after {
  background: var(--green);
}

.accent-amber::after {
  background: var(--amber);
}

.accent-rose::after {
  background: var(--rose);
}

.dashboard-grid,
.split-grid,
.settings-grid,
.keyword-engine-grid,
.logic-grid {
  gap: 16px;
}

.panel {
  padding: 18px;
}

.panel-header {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(25, 39, 52, 0.08);
}

.panel-badge {
  color: #8d5b00;
  border-color: rgba(231, 151, 34, 0.24);
  background: rgba(255, 246, 224, 0.9);
}

.panel-badge.live {
  color: #087445;
  border-color: rgba(22, 163, 106, 0.22);
  background: rgba(232, 250, 240, 0.92);
}

.radar-item,
.priority-item,
.pipeline-item,
.funnel-item,
.task-item,
.mission-item,
.insight-item,
.alert-item,
.tracking-meter,
.pixel-code-box,
.open-event-list,
.automation-stat,
.mail-queue-item,
.source-note,
.free-source-box,
.free-test-import,
.logic-step,
.keyword-output,
.keyword-pack-head > div,
.keyword-section,
.keyword-matrix > div,
.category-option,
.detail-empty-hero,
.detail-empty-stat,
.detail-empty-lead,
.detail-empty-fallback,
.identity-block,
.contact-card,
.field-box,
.settings-note,
.device-strip,
.cost-preview {
  border-color: rgba(25, 39, 52, 0.1);
  background: rgba(255, 255, 255, 0.72);
}

.priority-item:hover,
.detail-empty-lead:hover,
tbody tr:hover {
  border-color: rgba(0, 151, 167, 0.28);
  background: rgba(232, 249, 252, 0.8);
}

.alert-item {
  border-left-color: var(--amber);
}

.alert-item.info {
  border-left-color: var(--cyan);
}

.alert-item.danger {
  border-left-color: var(--rose);
}

.progress-track {
  background: rgba(33, 53, 72, 0.1);
}

.progress-fill {
  background: linear-gradient(90deg, var(--cyan), var(--blue), var(--amber));
}

.score-pill,
.status-pill,
.email-grade {
  background: #ffffff;
  border-color: rgba(0, 151, 167, 0.22);
  color: var(--cyan);
}

.status-pill,
.grade-a,
.grade-b {
  color: var(--green);
  border-color: rgba(22, 163, 106, 0.24);
}

.grade-c {
  color: var(--amber);
  border-color: rgba(231, 151, 34, 0.28);
}

.grade-d,
.grade-f {
  color: var(--rose);
  border-color: rgba(232, 87, 87, 0.3);
}

.source-channel-grid label,
.free-source-grid span,
.keyword-chip {
  color: var(--cyan);
  border-color: rgba(0, 151, 167, 0.2);
  background: rgba(232, 249, 252, 0.86);
}

.toolbar-select,
.lead-label-select,
.lead-star-btn,
.lead-note-btn {
  border-color: rgba(25, 39, 52, 0.12);
  background-color: #ffffff;
  color: var(--text);
}

.lead-column-menu {
  border-color: rgba(25, 39, 52, 0.12);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(25, 39, 52, 0.14);
}

.lead-column-menu-head strong {
  color: var(--ink);
}

.lead-column-option {
  border-color: rgba(25, 39, 52, 0.1);
  background: rgba(247, 251, 255, 0.82);
}

.lead-column-option:hover {
  border-color: rgba(0, 151, 167, 0.28);
  background: rgba(231, 250, 252, 0.95);
}

.lead-column-option-name {
  color: var(--ink);
}

.lead-column-option-badge {
  background: rgba(0, 151, 167, 0.1);
  color: #00899a;
}

.lead-column-menu p {
  color: var(--muted);
}

.lead-star-btn.is-active {
  border-color: rgba(231, 151, 34, 0.42);
  background: rgba(255, 246, 224, 0.92);
  color: #b96b00;
}

.lead-note-btn.has-note {
  border-color: rgba(0, 151, 167, 0.28);
  background: rgba(232, 249, 252, 0.9);
  color: var(--cyan);
}

.keyword-chip.muted {
  color: var(--muted);
  border-color: rgba(25, 39, 52, 0.12);
  background: rgba(244, 247, 250, 0.9);
}

button.keyword-chip {
  appearance: none;
  font: inherit;
  cursor: pointer;
}

.keyword-chip-button:hover {
  color: #ffffff;
  border-color: rgba(47, 107, 255, 0.72);
  background: linear-gradient(135deg, #00a7b5, #316bff);
  box-shadow: 0 10px 24px rgba(47, 107, 255, 0.18);
}

.keyword-chip-button.is-selected {
  color: #ffffff;
  border-color: rgba(47, 107, 255, 0.86);
  background: linear-gradient(135deg, #0097a7, #316bff 62%, #6f4ee8);
  box-shadow: 0 12px 26px rgba(47, 107, 255, 0.22);
}

.task-index,
.logic-step span {
  color: #ffffff;
  border: 0;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.logic-step.paid-step {
  border-color: rgba(231, 151, 34, 0.22);
  background: rgba(255, 248, 232, 0.88);
}

.logic-step.paid-step span {
  color: #ffffff;
  background: linear-gradient(135deg, var(--amber), var(--rose));
}

.task-command,
.pixel-code-box code,
.keyword-section code,
code {
  color: #8b5600;
  background: rgba(255, 248, 232, 0.76);
}

.task-command {
  border-color: rgba(231, 151, 34, 0.22);
}

.table-wrap {
  border-color: rgba(25, 39, 52, 0.11);
  background: rgba(255, 255, 255, 0.82);
}

table {
  background: #ffffff;
  min-width: var(--lead-table-min-width, 980px);
  table-layout: fixed;
}

#leadTable .is-hidden-column {
  display: none;
}

#leadTable th[data-column="company"],
#leadTable td[data-column="company"] {
  width: 300px;
}

#leadTable th[data-column="mark"],
#leadTable td[data-column="mark"] {
  width: 220px;
}

#leadTable th[data-column="country"],
#leadTable td[data-column="country"] {
  width: 118px;
}

#leadTable th[data-column="segment"],
#leadTable td[data-column="segment"] {
  width: 118px;
}

#leadTable th[data-column="primaryContact"],
#leadTable td[data-column="primaryContact"] {
  width: 270px;
}

#leadTable th[data-column="contactCount"],
#leadTable td[data-column="contactCount"] {
  width: 92px;
  text-align: center;
}

#leadTable th[data-column="emailScore"],
#leadTable td[data-column="emailScore"] {
  width: 130px;
}

#leadTable th[data-column="score"],
#leadTable td[data-column="score"] {
  width: 104px;
}

#leadTable th[data-column="status"],
#leadTable td[data-column="status"] {
  width: 132px;
}

#leadTable th[data-column="createdAt"],
#leadTable td[data-column="createdAt"] {
  width: 158px;
}

#leadTable th[data-column="source"],
#leadTable td[data-column="source"] {
  width: 170px;
}

#leadTable th:last-child,
#leadTable td:last-child {
  width: 96px;
  text-align: center;
}

th {
  color: #506171;
  background: #f2f6fa;
  text-transform: none;
  font-weight: 860;
  white-space: nowrap;
}

td {
  color: #263644;
  overflow-wrap: normal;
  word-break: normal;
}

th,
td {
  padding: 12px 10px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 42px;
  text-align: center;
}

th:nth-child(2),
td:nth-child(2) {
  width: 21%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 8%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 7%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 20%;
}

th:nth-child(6),
td:nth-child(6) {
  width: 6%;
  text-align: center;
}

th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8),
th:nth-child(9),
td:nth-child(9) {
  width: 8%;
}

th:nth-child(10),
td:nth-child(10) {
  width: 8%;
}

th:nth-child(11),
td:nth-child(11) {
  width: 6%;
  text-align: center;
}

.lead-select-cell {
  vertical-align: middle;
}

.lead-check {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin: 0;
  cursor: pointer;
}

.lead-check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lead-check span {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(20, 42, 57, 0.22);
  border-radius: 5px;
  background: #ffffff;
  box-shadow: inset 0 0 0 2px #ffffff;
}

.lead-check input:checked + span {
  border-color: rgba(37, 99, 235, 0.7);
  background: linear-gradient(135deg, #1aa0d6, #5264f6);
  box-shadow: inset 0 0 0 4px #ffffff;
}

.lead-check input:indeterminate + span {
  border-color: rgba(37, 99, 235, 0.7);
  background:
    linear-gradient(#ffffff, #ffffff) center / 9px 2px no-repeat,
    linear-gradient(135deg, #1aa0d6, #5264f6);
}

.lead-delete-btn {
  min-width: 58px;
  padding-inline: 10px;
}

.table-company strong {
  color: #101d28;
}

.th-filter select {
  border-color: rgba(25, 39, 52, 0.14);
  background-color: #ffffff;
  color: #506171;
}

.th-filter select option {
  color: #14212b;
}

.table-pagination {
  color: var(--muted);
}

.empty-compact {
  border-color: rgba(25, 39, 52, 0.14);
  background: rgba(244, 248, 252, 0.7);
}

.detail-empty-hero {
  background:
    linear-gradient(135deg, rgba(0, 151, 167, 0.12), transparent 46%),
    linear-gradient(90deg, rgba(53, 109, 255, 0.08), rgba(255, 255, 255, 0.74));
}

.score-ring {
  background:
    radial-gradient(circle at center, #ffffff 58%, transparent 59%),
    conic-gradient(var(--green) var(--score-angle), rgba(33, 53, 72, 0.12) 0);
}

.tag,
.feature {
  color: #8b5600;
  border-color: rgba(231, 151, 34, 0.25);
  background: rgba(255, 248, 232, 0.88);
}

.draft-box {
  background: #ffffff;
}

.activation-screen {
  background: transparent;
}

.activation-visual,
.activation-panel {
  border-color: rgba(25, 39, 52, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 252, 0.86)),
    linear-gradient(90deg, rgba(0, 151, 167, 0.1), transparent);
  box-shadow: var(--shadow);
}

.radar,
.radar-core {
  border-color: rgba(0, 151, 167, 0.28);
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(0, 151, 167, 0.18) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(53, 109, 255, 0.16) 50%, transparent 50.5%),
    rgba(255, 255, 255, 0.42);
}

.signal-stack div {
  border-color: rgba(53, 109, 255, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(53, 109, 255, 0.1));
}

@media (max-width: 1280px) {
  .kpi-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
  }
}

@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    margin: 12px;
    min-height: auto;
  }

  .main {
    padding: 0 12px 24px;
  }

  .topbar {
    position: relative;
  }
}

@media (max-width: 720px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .panel,
  .metric-panel {
    border-radius: 8px;
  }

  .sidebar {
    margin: 8px;
  }
}

/* Executive BI cockpit */
:root {
  --executive-bg: #f3f6fb;
  --executive-ink: #111827;
  --executive-muted: #657488;
  --executive-blue: #2867ff;
  --executive-cyan: #00a7b5;
  --executive-green: #20b981;
  --executive-violet: #7357e8;
  --executive-amber: #f3a72c;
  --executive-rose: #ef5b6d;
}

body {
  background:
    linear-gradient(118deg, rgba(40, 103, 255, 0.08) 0 16%, transparent 16% 100%),
    linear-gradient(145deg, transparent 0 63%, rgba(0, 167, 181, 0.08) 63% 73%, transparent 73%),
    linear-gradient(180deg, #fbfcff 0%, var(--executive-bg) 100%);
}

.workspace {
  grid-template-columns: 232px minmax(0, 1fr);
}

.sidebar {
  margin: 0;
  min-height: 100vh;
  border-width: 0 1px 0 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 18px 0 44px rgba(16, 24, 40, 0.05);
}

.sidebar-brand {
  padding: 8px 6px 22px;
}

.brand-mark {
  background: linear-gradient(145deg, #5f59ff, #2867ff 54%, #00a7b5);
}

.nav-list {
  gap: 5px;
}

.nav-btn {
  min-height: 42px;
  font-size: 0.93rem;
}

.nav-btn.active,
.nav-btn:hover {
  border-color: rgba(40, 103, 255, 0.16);
  background: linear-gradient(90deg, rgba(40, 103, 255, 0.1), rgba(255, 255, 255, 0.64));
}

.nav-btn.active span {
  background: linear-gradient(135deg, var(--executive-blue), var(--executive-violet));
}

.main {
  padding: 18px 26px 34px;
}

.topbar {
  min-height: 72px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border-color: rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.06);
}

.topbar h2 {
  font-size: 1.55rem;
}

.topbar::after {
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, var(--executive-blue), var(--executive-cyan), var(--executive-amber));
}

.mini-stat {
  min-width: 112px;
  background: #f7f9fc;
}

.executive-hero {
  min-height: 244px;
  display: grid;
  grid-template-columns: minmax(380px, 1.18fr) minmax(280px, 0.8fr) minmax(250px, 0.62fr);
  gap: 16px;
  margin-bottom: 16px;
}

.executive-copy,
.global-signal-card,
.system-stack-card {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 45px rgba(16, 24, 40, 0.08);
}

.executive-copy {
  padding: 26px;
  background:
    linear-gradient(128deg, rgba(40, 103, 255, 0.12), transparent 36%),
    linear-gradient(100deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 255, 0.78));
}

.executive-copy h1 {
  max-width: 780px;
  margin: 4px 0 12px;
  color: var(--executive-ink);
  font-size: clamp(2.2rem, 4vw, 4.4rem);
  font-weight: 920;
}

.executive-copy > span {
  display: block;
  max-width: 760px;
  color: var(--executive-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}

.hero-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.hero-chip-row span {
  min-height: 32px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid rgba(40, 103, 255, 0.14);
  border-radius: 8px;
  color: #2456d6;
  background: rgba(238, 244, 255, 0.92);
  font-weight: 780;
  font-size: 0.84rem;
}

.global-signal-card {
  padding: 18px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  background:
    linear-gradient(155deg, rgba(10, 25, 47, 0.96), rgba(22, 38, 67, 0.94)),
    linear-gradient(90deg, rgba(0, 167, 181, 0.3), transparent);
  color: #ffffff;
  overflow: hidden;
}

.signal-orbit {
  min-height: 156px;
  position: relative;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
}

.signal-orbit i {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(72, 220, 255, 0.22);
  border-radius: 50%;
}

.signal-orbit i:nth-child(2) {
  inset: 28%;
}

.signal-orbit i:nth-child(3) {
  inset: 40%;
}

.signal-dot {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #27e6be;
  box-shadow: 0 0 18px rgba(39, 230, 190, 0.75);
}

.dot-us {
  left: 22%;
  top: 42%;
}

.dot-eu {
  left: 52%;
  top: 32%;
  background: #76a7ff;
}

.dot-au {
  right: 16%;
  bottom: 22%;
  background: #f5b948;
}

.dot-me {
  right: 34%;
  top: 48%;
  background: #ff6f88;
}

.signal-caption strong,
.signal-caption span {
  display: block;
}

.signal-caption span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
}

.system-stack-card {
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 10px;
}

.system-line {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: #f8fafc;
}

.system-line span {
  color: var(--executive-muted);
  font-size: 0.82rem;
}

.system-line strong {
  color: var(--executive-ink);
  font-size: 1rem;
}

.executive-kpi-grid {
  grid-template-columns: repeat(7, minmax(128px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.executive-kpi-grid .metric-panel {
  min-height: 126px;
  padding: 15px;
  background: #ffffff;
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 16px 34px rgba(16, 24, 40, 0.07);
}

.metric-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--executive-blue), var(--executive-cyan));
  font-weight: 900;
}

.accent-blue::after {
  background: var(--executive-blue);
}

.accent-violet::after {
  background: var(--executive-violet);
}

.executive-kpi-grid .metric-panel strong {
  margin: 5px 0 3px;
  font-size: clamp(1.75rem, 3vw, 2.55rem);
}

.executive-grid {
  gap: 16px;
}

.executive-grid .panel {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(17, 24, 39, 0.08);
  box-shadow: 0 18px 42px rgba(16, 24, 40, 0.07);
}

.command-chart-panel {
  min-height: 420px;
}

.trend-chart {
  min-height: 318px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: var(--executive-muted);
  font-size: 0.84rem;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.chart-legend i {
  width: 22px;
  height: 3px;
  border-radius: 999px;
  display: inline-block;
}

.line-blue {
  background: var(--executive-blue);
}

.line-green {
  background: var(--executive-green);
}

.line-violet {
  background: var(--executive-violet);
}

.trend-chart svg {
  width: 100%;
  min-height: 270px;
}

.chart-grid-lines line {
  stroke: rgba(17, 24, 39, 0.08);
}

.chart-area {
  fill: url("#chartBlueFill");
}

.chart-line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-blue-stroke {
  stroke: var(--executive-blue);
}

.line-green-stroke {
  stroke: var(--executive-green);
}

.line-violet-stroke {
  stroke: var(--executive-violet);
}

.chart-labels text {
  fill: var(--executive-muted);
  font-size: 13px;
}

.command-activity-panel {
  min-height: 420px;
}

.activity-feed {
  display: grid;
  gap: 11px;
}

.activity-feed div {
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: #f8fafc;
}

.today-action-item {
  width: 100%;
  min-height: 66px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 18px;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  color: inherit;
  background: #f8fafc;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.today-action-item:hover,
.today-action-item:focus-visible {
  border-color: rgba(37, 99, 235, 0.34);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
  outline: none;
}

.today-action-item b {
  grid-column: 1;
  grid-row: 1 / span 2;
}

.today-action-item span {
  grid-column: 2;
  grid-row: 1;
}

.today-action-item small {
  grid-column: 2;
  grid-row: 2;
}

.today-action-item em {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  color: #64748b;
  font-size: 1.35rem;
  font-style: normal;
  text-align: right;
}

.today-action-item[data-tone="danger"] b {
  background: linear-gradient(135deg, #ef4444, #f97316);
}

.today-action-item[data-tone="success"] b,
.today-action-item[data-tone="ready"] b {
  background: linear-gradient(135deg, #10b981, #14b8a6);
}

.today-action-item[data-tone="priority"] b {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
}

.today-action-item[data-tone="warning"] b {
  background: linear-gradient(135deg, #d97706, #f59e0b);
}

.activity-feed b {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--executive-blue), var(--executive-violet));
  font-size: 0.8rem;
}

.activity-feed span {
  color: var(--executive-ink);
  font-weight: 820;
}

.activity-feed small {
  margin-top: 3px;
  color: var(--executive-muted);
}

.priority-panel .priority-list,
.running-task-panel .task-stream {
  max-height: 390px;
  overflow: auto;
  padding-right: 2px;
}

.priority-item,
.task-item,
.mission-item,
.insight-item,
.funnel-item,
.alert-item,
.tracking-meter,
.pixel-code-box,
.open-event-list {
  background: #f8fafc;
  border-color: rgba(17, 24, 39, 0.08);
}

.tracking-panel .tracking-grid {
  grid-template-columns: minmax(180px, 0.4fr) minmax(320px, 0.78fr) minmax(300px, 0.72fr);
}

.tracking-meter strong {
  color: var(--executive-green);
}

.panel-badge {
  border-color: rgba(40, 103, 255, 0.14);
  color: #2456d6;
  background: rgba(238, 244, 255, 0.92);
}

.panel-badge.live {
  color: #08784c;
  border-color: rgba(32, 185, 129, 0.18);
  background: rgba(232, 250, 242, 0.96);
}

.primary-btn {
  background: linear-gradient(135deg, var(--executive-blue), var(--executive-violet));
}

@media (max-width: 1320px) {
  .executive-hero {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.72fr);
  }

  .system-stack-card {
    grid-column: span 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .executive-kpi-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
  }
}

@media (max-width: 980px) {
  .executive-hero,
  .system-stack-card,
  .tracking-panel .tracking-grid {
    grid-template-columns: 1fr;
  }

  .system-stack-card {
    grid-column: auto;
  }

  .executive-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .main {
    padding: 10px 12px 24px;
  }

  .executive-copy {
    padding: 18px;
  }

  .executive-copy h1 {
    font-size: 2rem;
  }

  .executive-kpi-grid {
    grid-template-columns: 1fr;
  }

  .trend-chart svg {
    min-height: 210px;
  }
}

/* Dense command center dashboard */
#dashboardView {
  --dash-card: rgba(255, 255, 255, 0.9);
  --dash-line: rgba(18, 31, 48, 0.09);
  --dash-shadow: 0 18px 40px rgba(20, 35, 58, 0.08);
}

.command-shell {
  display: grid;
  gap: 12px;
}

.command-welcome {
  min-height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.28fr);
  align-items: center;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--dash-line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(40, 103, 255, 0.12), transparent 28%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.97), rgba(247, 250, 255, 0.88));
  box-shadow: var(--dash-shadow);
  position: relative;
  overflow: hidden;
}

.command-welcome::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -110px;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(40, 103, 255, 0.12);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(0, 167, 181, 0.18), transparent 48%),
    repeating-conic-gradient(from 40deg, rgba(40, 103, 255, 0.15) 0deg 8deg, transparent 8deg 22deg);
  opacity: 0.8;
}

.command-welcome h1 {
  margin: 2px 0 8px;
  color: #101827;
  font-size: clamp(1.8rem, 3vw, 2.85rem);
}

.command-welcome span {
  color: #657488;
  line-height: 1.6;
}

.command-date-card {
  min-height: 76px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(40, 103, 255, 0.13);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  position: relative;
  z-index: 1;
}

.command-date-card span {
  color: #657488;
  font-size: 0.8rem;
}

.command-date-card strong {
  color: #101827;
}

.command-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.command-status-grid > div {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid var(--dash-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 24px rgba(20, 35, 58, 0.05);
}

.command-status-grid span {
  color: #657488;
  font-size: 0.8rem;
}

.command-status-grid strong {
  color: #111827;
  font-size: 1.02rem;
}

.command-kpi-grid {
  grid-template-columns: repeat(7, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.command-kpi-grid .metric-panel {
  min-height: 118px;
  padding: 13px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 255, 0.86));
  border-color: var(--dash-line);
  box-shadow: 0 14px 30px rgba(20, 35, 58, 0.065);
}

.command-kpi-grid .metric-icon {
  width: 34px;
  height: 28px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 0.74rem;
}

.command-kpi-grid .metric-panel strong {
  margin: 4px 0 2px;
  font-size: clamp(1.65rem, 2.5vw, 2.35rem);
}

.command-main-grid {
  display: grid;
  grid-template-columns: minmax(460px, 1.18fr) minmax(300px, 0.72fr) minmax(300px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.command-main-grid .panel,
.command-lower-grid .panel {
  margin: 0;
  border-color: var(--dash-line);
  background: var(--dash-card);
  box-shadow: var(--dash-shadow);
}

.command-main-grid .panel-header,
.command-lower-grid .panel-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.command-chart-panel {
  min-height: 372px;
}

.trend-chart {
  min-height: 286px;
}

.trend-chart svg {
  min-height: 238px;
}

.command-activity-panel,
.running-task-panel {
  min-height: 372px;
}

.activity-feed {
  gap: 9px;
}

.activity-feed div {
  min-height: 58px;
  border-color: rgba(18, 31, 48, 0.08);
  background:
    linear-gradient(90deg, rgba(40, 103, 255, 0.07), transparent 42%),
    #f8fafc;
}

.panel-link {
  display: inline-block;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2867ff;
  font-size: 0.86rem;
  font-weight: 800;
  text-decoration: none;
}

.running-task-panel .task-stream {
  max-height: 276px;
  overflow: auto;
}

.running-task-panel .task-item {
  grid-template-columns: auto minmax(0, 1fr);
}

.running-task-panel .task-item > div:last-child {
  grid-column: 1 / -1;
}

.command-lower-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.2fr) minmax(260px, 0.7fr) minmax(340px, 0.9fr);
  gap: 12px;
}

.priority-panel {
  grid-row: span 2;
}

.priority-panel .priority-list {
  max-height: 424px;
  overflow: auto;
}

.source-board-panel,
.tracking-panel {
  grid-column: span 2;
}

.source-board {
  display: grid;
  grid-template-columns: minmax(150px, 0.44fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.donut-card {
  min-height: 178px;
  display: grid;
  place-items: center;
}

.donut-ring {
  width: 146px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 50%, transparent 51%),
    conic-gradient(#2867ff 0 38%, #20b981 38% 63%, #f3a72c 63% 78%, #7357e8 78% 90%, #cbd5e1 90% 100%);
  box-shadow: inset 0 0 0 1px rgba(18, 31, 48, 0.06), 0 16px 34px rgba(40, 103, 255, 0.12);
}

.donut-ring strong {
  color: #111827;
  font-size: 2rem;
  line-height: 1;
}

.donut-ring span {
  color: #657488;
  font-size: 0.82rem;
}

.market-panel .insight-list,
.template-panel .insight-list,
.pipeline-panel .funnel-list,
.risk-panel .alert-list {
  max-height: 232px;
  overflow: auto;
}

.tracking-panel .tracking-grid {
  grid-template-columns: minmax(170px, 0.38fr) minmax(280px, 0.78fr) minmax(260px, 0.72fr);
}

.tracking-panel {
  min-height: 230px;
}

.priority-item,
.task-item,
.mission-item,
.insight-item,
.funnel-item,
.alert-item,
.tracking-meter,
.pixel-code-box,
.open-event-list {
  border-color: rgba(18, 31, 48, 0.08);
  background: #f8fafc;
}

@media (max-width: 1360px) {
  .command-kpi-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .command-main-grid,
  .command-lower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .command-chart-panel,
  .priority-panel,
  .source-board-panel,
  .tracking-panel {
    grid-column: span 2;
  }
}

@media (max-width: 980px) {
  .command-welcome,
  .command-status-grid,
  .command-main-grid,
  .command-lower-grid,
  .source-board,
  .tracking-panel .tracking-grid {
    grid-template-columns: 1fr;
  }

  .command-chart-panel,
  .priority-panel,
  .source-board-panel,
  .tracking-panel {
    grid-column: auto;
  }

  .command-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .command-kpi-grid {
    grid-template-columns: 1fr;
  }

  .command-welcome {
    padding: 16px;
  }
}

/* AI MailPro-like premium dashboard structure */
.workspace:has(#dashboardView.active) .topbar {
  display: none;
}

.workspace:has(#dashboardView.active) .main {
  padding-top: 22px;
}

.grouped-nav {
  gap: 18px;
}

.nav-section {
  display: grid;
  gap: 5px;
}

.nav-section p {
  margin: 6px 10px 4px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 800;
}

.workspace:has(#dashboardView.active) .sidebar {
  background: #ffffff;
  box-shadow: 16px 0 40px rgba(15, 23, 42, 0.04);
}

.workspace:has(#dashboardView.active) .sidebar-brand {
  min-height: 70px;
}

.workspace:has(#dashboardView.active) .sidebar-status {
  background: #f8fafc;
}

.workspace:has(#dashboardView.active) .nav-btn {
  min-height: 38px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 760;
}

.workspace:has(#dashboardView.active) .nav-btn span {
  width: 24px;
  height: 24px;
  background: transparent;
}

.workspace:has(#dashboardView.active) .nav-btn.active,
.workspace:has(#dashboardView.active) .nav-btn:hover {
  background: #eef4ff;
  border-color: transparent;
  color: #1d4ed8;
}

.workspace:has(#dashboardView.active) .nav-btn.active span {
  color: #1d4ed8;
  background: transparent;
}

.workspace:has(#dashboardView.active) .command-shell {
  gap: 13px;
}

.workspace:has(#dashboardView.active) .command-welcome {
  min-height: 88px;
  padding: 4px 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.workspace:has(#dashboardView.active) .command-welcome::after {
  display: none;
}

.workspace:has(#dashboardView.active) .command-welcome h1 {
  margin: 2px 0 6px;
  font-size: clamp(1.55rem, 2.5vw, 2.2rem);
}

.workspace:has(#dashboardView.active) .command-date-card {
  min-height: 48px;
  justify-self: end;
  min-width: 250px;
  padding: 10px 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.workspace:has(#dashboardView.active) .command-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.workspace:has(#dashboardView.active) .command-status-grid > div {
  min-height: 52px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
}

.workspace:has(#dashboardView.active) .command-kpi-grid {
  grid-template-columns: repeat(7, minmax(124px, 1fr));
  gap: 12px;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel {
  min-height: 112px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 12px;
  align-items: center;
  padding: 14px;
  background: #ffffff;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-icon {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 50%;
  font-size: 0.72rem;
  background: #eaf2ff;
  color: #2563eb;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel:nth-child(2) .metric-icon,
.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel:nth-child(5) .metric-icon {
  background: #e7fbf2;
  color: #059669;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel:nth-child(4) .metric-icon,
.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel:nth-child(6) .metric-icon {
  background: #f3efff;
  color: #6d5bd0;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel:nth-child(7) .metric-icon {
  background: #fff4df;
  color: #d97706;
}

.workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel strong {
  font-size: clamp(1.55rem, 2vw, 2.1rem);
}

.workspace:has(#dashboardView.active) .command-main-grid {
  grid-template-columns: minmax(470px, 1.1fr) minmax(300px, 0.72fr) minmax(300px, 0.72fr);
}

.workspace:has(#dashboardView.active) .command-chart-panel,
.workspace:has(#dashboardView.active) .command-activity-panel,
.workspace:has(#dashboardView.active) .running-task-panel {
  min-height: 360px;
}

.workspace:has(#dashboardView.active) .trend-chart {
  min-height: 268px;
}

.workspace:has(#dashboardView.active) .trend-chart svg {
  min-height: 226px;
}

.workspace:has(#dashboardView.active) .command-lower-grid {
  grid-template-columns: minmax(560px, 1.18fr) minmax(360px, 0.82fr);
}

.workspace:has(#dashboardView.active) .priority-panel {
  grid-column: span 1;
  grid-row: span 1;
}

.workspace:has(#dashboardView.active) .source-board-panel {
  grid-column: span 1;
}

.workspace:has(#dashboardView.active) .tracking-panel {
  grid-column: span 2;
}

.priority-table-head,
.priority-item {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) 70px 90px;
  gap: 12px;
  align-items: center;
}

.priority-table-head {
  min-height: 38px;
  padding: 0 12px;
  color: #64748b;
  background: #f8fafc;
  border: 1px solid rgba(18, 31, 48, 0.07);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 850;
}

.priority-item {
  min-height: 54px;
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, 0.8fr) 70px 90px;
}

.priority-item > div:first-child {
  display: contents;
}

.priority-item > div:first-child span {
  color: #64748b;
}

.priority-meta {
  display: contents;
}

.priority-meta small {
  justify-self: end;
  color: #64748b;
}

.workspace:has(#dashboardView.active) .source-board {
  grid-template-columns: 170px minmax(0, 1fr);
}

.workspace:has(#dashboardView.active) .market-panel,
.workspace:has(#dashboardView.active) .template-panel,
.workspace:has(#dashboardView.active) .risk-panel {
  min-height: 226px;
}

@media (max-width: 1360px) {
  .workspace:has(#dashboardView.active) .command-kpi-grid {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }

  .workspace:has(#dashboardView.active) .command-main-grid,
  .workspace:has(#dashboardView.active) .command-lower-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .workspace:has(#dashboardView.active) .command-welcome,
  .workspace:has(#dashboardView.active) .command-status-grid,
  .workspace:has(#dashboardView.active) .command-main-grid,
  .workspace:has(#dashboardView.active) .command-lower-grid {
    grid-template-columns: 1fr;
  }

  .workspace:has(#dashboardView.active) .tracking-panel {
    grid-column: auto;
  }

  .priority-table-head,
  .priority-item {
    grid-template-columns: 1fr auto;
  }

  .priority-table-head span:nth-child(2),
  .priority-table-head span:nth-child(4),
  .priority-item > div:first-child span,
  .priority-meta small {
    display: none;
  }
}

/* TradeLead Atlas cockpit: distinct demo-grade home screen */
.workspace:has(#dashboardView.active) {
  background:
    linear-gradient(rgba(34, 85, 113, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 85, 113, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f7fafc 0%, #eef5fb 48%, #f8f5f0 100%);
  background-size:
    30px 30px,
    30px 30px,
    auto;
}

.workspace:has(#dashboardView.active) .main {
  color: #102033;
  padding: 20px 26px 34px;
}

.workspace:has(#dashboardView.active) .sidebar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 252, 0.95)),
    linear-gradient(90deg, rgba(22, 120, 170, 0.1), transparent 38%);
  border-right: 1px solid rgba(33, 55, 79, 0.1);
  color: #102033;
}

.workspace:has(#dashboardView.active) .sidebar-brand strong,
.workspace:has(#dashboardView.active) .nav-btn,
.workspace:has(#dashboardView.active) .sidebar-status strong {
  color: #102033;
}

.workspace:has(#dashboardView.active) .nav-section p {
  color: #7a8795;
}

.workspace:has(#dashboardView.active) .nav-btn.active,
.workspace:has(#dashboardView.active) .nav-btn:hover {
  color: #0f78a6;
  background: linear-gradient(90deg, rgba(18, 182, 203, 0.12), rgba(55, 124, 246, 0.08));
  box-shadow: inset 3px 0 0 #12b6cb;
}

.atlas-command {
  display: grid;
  gap: 12px;
  width: 100%;
  min-width: 0;
  max-width: 1620px;
  margin: 0 auto;
}

.atlas-command > *,
.atlas-hero,
.atlas-topology,
.atlas-visual-card,
.atlas-kpi-panel,
.atlas-flow-panel,
.atlas-workgrid,
.atlas-intel-grid,
.command-main-grid,
.command-lower-grid {
  min-width: 0;
  max-width: 100%;
}

.atlas-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.36fr);
  gap: 14px;
  align-items: stretch;
}

.atlas-hero-copy,
.atlas-status-stack,
.atlas-visual-card,
.atlas-kpi-panel,
.atlas-flow-panel,
.workspace:has(#dashboardView.active) .panel {
  border: 1px solid rgba(23, 45, 67, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow:
    0 16px 44px rgba(30, 56, 84, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
}

.atlas-hero-copy {
  min-height: 128px;
  padding: 20px 22px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(110deg, rgba(14, 27, 43, 0.96) 0%, rgba(18, 57, 79, 0.94) 63%, rgba(255, 255, 255, 0.82) 63.4%, rgba(255, 255, 255, 0.82) 100%);
}

.atlas-hero-copy::after {
  content: "";
  position: absolute;
  inset: 16px 20px auto auto;
  width: 210px;
  height: 48px;
  border-top: 2px solid rgba(18, 182, 203, 0.55);
  border-right: 2px solid rgba(245, 159, 56, 0.4);
  transform: skewX(-22deg);
}

.atlas-hero-copy .eyebrow,
.atlas-hero-copy h1,
.atlas-hero-copy > span {
  position: relative;
  max-width: 540px;
  color: #ffffff;
}

.atlas-hero-copy .eyebrow {
  color: #79e3ef;
}

.atlas-hero-copy h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.9rem, 3vw, 3.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.atlas-hero-copy > span {
  display: block;
  color: rgba(239, 246, 255, 0.78);
  font-size: 0.98rem;
}

.atlas-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  position: relative;
}

.atlas-hero-actions .primary-btn {
  background: linear-gradient(135deg, #12b6cb, #377cf6);
  border: 0;
  color: #ffffff;
  box-shadow: 0 12px 26px rgba(18, 127, 203, 0.28);
}

.atlas-hero-actions .panel-link {
  height: 38px;
  padding: 0 14px;
  border-radius: 7px;
  color: #e9f8ff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.atlas-status-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  min-height: 128px;
  padding: 0;
  overflow: hidden;
}

.atlas-status-stack > div {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 42px;
  padding: 10px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 250, 252, 0.72)),
    linear-gradient(135deg, rgba(18, 182, 203, 0.08), transparent);
}

.atlas-status-stack span {
  color: #778596;
  font-size: 0.72rem;
  font-weight: 800;
}

.atlas-status-stack strong {
  color: #102033;
  font-size: 0.98rem;
  line-height: 1.2;
}

.atlas-topology {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: 14px;
  align-items: stretch;
}

.atlas-visual-card {
  min-height: 398px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(246, 250, 253, 0.88)),
    linear-gradient(135deg, rgba(18, 182, 203, 0.08), rgba(245, 159, 56, 0.08));
}

.atlas-map-head,
.atlas-flow-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.workspace:has(#dashboardView.active) .eyebrow {
  color: #0f91a8;
}

.workspace:has(#dashboardView.active) h3 {
  color: #102033;
}

.atlas-map {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(26, 61, 88, 0.1);
  background:
    linear-gradient(135deg, rgba(18, 182, 203, 0.1), rgba(123, 97, 255, 0.08) 48%, rgba(245, 159, 56, 0.11)),
    #f7fbff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.7),
    0 18px 54px rgba(39, 104, 150, 0.1);
}

.atlas-map svg {
  display: block;
  width: 100%;
  height: 328px;
  min-height: 0;
}

.atlas-world-map-image {
  opacity: 0.96;
  pointer-events: none;
}

.atlas-land {
  display: none;
}

.atlas-grid-lines path {
  fill: none;
  stroke: rgba(31, 81, 111, 0.11);
  stroke-width: 1;
}

.atlas-land path {
  stroke: rgba(255, 255, 255, 0.86);
  stroke-width: 1.6;
  filter: url(#atlasSoftGlow);
  opacity: 0.92;
}

.atlas-land .land-north {
  fill: url(#atlasLandNorth);
}

.atlas-land .land-south {
  fill: url(#atlasLandSouth);
}

.atlas-land .land-europe {
  fill: url(#atlasLandEurope);
}

.atlas-land .land-asia {
  fill: url(#atlasLandAsia);
}

.atlas-land .land-africa {
  fill: rgba(255, 190, 108, 0.66);
}

.atlas-land .land-oceania {
  fill: url(#atlasLandOceania);
}

.atlas-routes path {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-dasharray: 10 13;
  animation: routePulse 9s linear infinite;
  filter: drop-shadow(0 5px 8px rgba(42, 115, 198, 0.2));
}

.atlas-routes .route-cyan {
  stroke: #13b8d4;
}

.atlas-routes .route-violet {
  stroke: #4f7cff;
}

.atlas-routes .route-rose {
  stroke: #ef5f88;
}

.atlas-routes .route-green {
  stroke: #1ab981;
}

.atlas-routes .route-gold {
  stroke: #f4a331;
}

.atlas-points circle {
  fill: #ffffff;
  stroke-width: 3;
  filter: drop-shadow(0 5px 9px rgba(18, 182, 203, 0.34));
}

.atlas-points .point-hub {
  fill: #102033;
  stroke: #f59f38;
  stroke-width: 4;
}

.atlas-points .point-cyan {
  stroke: #13b8d4;
}

.atlas-points .point-violet {
  stroke: #6e6aff;
}

.atlas-points .point-rose {
  stroke: #ef5f88;
}

.atlas-points .point-green {
  stroke: #19b983;
}

.atlas-points .point-gold {
  stroke: #f4a331;
}

.atlas-labels text {
  fill: #20364d;
  font-size: 17px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.atlas-map-legend rect {
  fill: rgba(255, 255, 255, 0.74);
  stroke: rgba(22, 132, 169, 0.16);
}

.atlas-map-legend circle {
  fill: #12b6cb;
  filter: drop-shadow(0 0 9px rgba(18, 182, 203, 0.58));
}

.atlas-map-legend text {
  fill: #28465d;
  font-size: 13px;
  font-weight: 800;
}

.signal-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.signal-strip span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #244057;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(25, 63, 92, 0.08);
  font-size: 0.78rem;
  font-weight: 850;
}

.atlas-kpi-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 9px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(241, 247, 252, 0.86)),
    linear-gradient(160deg, rgba(55, 124, 246, 0.08), rgba(245, 159, 56, 0.08));
}

.workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel {
  box-shadow: none;
}

.hero-metric {
  height: 98px;
  min-height: 98px;
  padding: 14px;
  color: #ffffff;
  background:
    linear-gradient(135deg, #102033 0%, #183e57 58%, #0e8198 100%) !important;
}

.hero-metric span,
.hero-metric small {
  color: rgba(255, 255, 255, 0.72);
}

.hero-metric strong {
  color: #ffffff;
  font-size: clamp(1.9rem, 3vw, 3rem);
  line-height: 0.95;
}

.atlas-mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 12px 10px;
  overflow: visible;
  border-color: rgba(35, 72, 101, 0.08);
  background: rgba(255, 255, 255, 0.74);
}

.atlas-mini-metrics .metric-panel span,
.atlas-mini-metrics .metric-panel small {
  display: block;
  color: #718093;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
  margin: 0;
}

.atlas-mini-metrics .metric-panel strong {
  display: block;
  color: #13283c;
  font-size: 1.5rem !important;
  line-height: 1;
  margin: 0;
}

.atlas-flow-panel {
  padding: 12px 14px;
  background:
    linear-gradient(90deg, rgba(16, 32, 51, 0.96), rgba(19, 63, 78, 0.92)),
    linear-gradient(135deg, rgba(18, 182, 203, 0.18), rgba(245, 159, 56, 0.14));
}

.atlas-flow-panel .eyebrow,
.atlas-flow-panel h3,
.atlas-flow-panel span,
.atlas-flow-panel strong {
  color: #ffffff;
}

.atlas-flow-head {
  margin-bottom: 8px;
}

.atlas-flow-head > span {
  align-self: center;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #bfeef5;
  font-size: 0.78rem;
  font-weight: 850;
}

.atlas-flow {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 8px;
}

.atlas-flow > div {
  height: 70px;
  min-height: 70px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 8px 10px;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
}

.atlas-flow > div:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -9px;
  top: 50%;
  width: 8px;
  border-top: 2px solid rgba(121, 227, 239, 0.5);
}

.atlas-flow b {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #102033;
  background: #79e3ef;
  font-size: 0.72rem;
}

.atlas-flow strong {
  font-size: 0.82rem;
}

.atlas-flow span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.68rem;
  line-height: 1.25;
}

.workspace:has(#dashboardView.active) .atlas-workgrid {
  grid-template-columns: minmax(0, 1.1fr) minmax(230px, 0.7fr) minmax(260px, 0.82fr);
  gap: 14px;
}

.workspace:has(#dashboardView.active) .panel {
  padding: 16px;
}

.workspace:has(#dashboardView.active) .command-chart-panel,
.workspace:has(#dashboardView.active) .command-activity-panel,
.workspace:has(#dashboardView.active) .running-task-panel {
  min-height: 338px;
}

.workspace:has(#dashboardView.active) .trend-chart {
  background:
    linear-gradient(180deg, rgba(248, 252, 255, 0.94), rgba(255, 255, 255, 0.96)),
    linear-gradient(135deg, rgba(55, 124, 246, 0.08), rgba(18, 182, 203, 0.08));
  border: 1px solid rgba(28, 67, 96, 0.08);
}

.workspace:has(#dashboardView.active) .activity-feed div,
.workspace:has(#dashboardView.active) .task-card,
.workspace:has(#dashboardView.active) .empty-state {
  color: #102033;
  background: rgba(248, 250, 252, 0.86);
  border-color: rgba(29, 69, 98, 0.08);
}

.workspace:has(#dashboardView.active) .activity-feed b {
  color: #0f91a8;
}

.workspace:has(#dashboardView.active) .activity-feed small,
.workspace:has(#dashboardView.active) .empty-state span {
  color: #718093;
}

.workspace:has(#dashboardView.active) .atlas-intel-grid {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr) minmax(260px, 0.68fr);
  gap: 14px;
}

.workspace:has(#dashboardView.active) .priority-panel {
  grid-row: span 2;
}

.workspace:has(#dashboardView.active) .tracking-panel {
  grid-column: span 2;
}

.workspace:has(#dashboardView.active) .risk-panel {
  grid-column: auto;
}

.workspace:has(#dashboardView.active) .priority-table-head,
.workspace:has(#dashboardView.active) .priority-item,
.workspace:has(#dashboardView.active) .funnel-item,
.workspace:has(#dashboardView.active) .insight-item,
.workspace:has(#dashboardView.active) .alert-item,
.workspace:has(#dashboardView.active) .open-event,
.workspace:has(#dashboardView.active) .tracking-meter,
.workspace:has(#dashboardView.active) .pixel-code-box {
  color: #102033;
  background: rgba(248, 250, 252, 0.86);
  border-color: rgba(29, 69, 98, 0.08);
}

.workspace:has(#dashboardView.active) .priority-table-head {
  color: #718093;
}

.workspace:has(#dashboardView.active) .priority-item:hover {
  background: #ffffff;
  border-color: rgba(18, 182, 203, 0.28);
  box-shadow: 0 12px 28px rgba(18, 96, 129, 0.09);
}

.workspace:has(#dashboardView.active) .priority-item strong,
.workspace:has(#dashboardView.active) .insight-item strong,
.workspace:has(#dashboardView.active) .funnel-item strong,
.workspace:has(#dashboardView.active) .tracking-meter strong,
.workspace:has(#dashboardView.active) .open-event strong {
  color: #102033;
}

.workspace:has(#dashboardView.active) .priority-item span,
.workspace:has(#dashboardView.active) .insight-item span,
.workspace:has(#dashboardView.active) .funnel-item span,
.workspace:has(#dashboardView.active) .tracking-meter small,
.workspace:has(#dashboardView.active) .pixel-code-box span,
.workspace:has(#dashboardView.active) .open-event span,
.workspace:has(#dashboardView.active) .alert-item span {
  color: #718093;
}

.workspace:has(#dashboardView.active) .donut-card {
  background: transparent;
}

.workspace:has(#dashboardView.active) .donut-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 47%, transparent 48%),
    conic-gradient(#377cf6 0 38%, #12b6cb 38% 64%, #f59f38 64% 82%, #e2557b 82% 100%);
  color: #102033;
}

.workspace:has(#dashboardView.active) .progress-fill {
  background: linear-gradient(90deg, #12b6cb, #377cf6, #f59f38);
}

.empty-command {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed rgba(15, 145, 168, 0.28);
  background:
    linear-gradient(135deg, rgba(18, 182, 203, 0.08), rgba(245, 159, 56, 0.08)),
    rgba(255, 255, 255, 0.72);
  color: #102033;
}

.empty-command strong {
  font-size: 1.05rem;
}

.empty-command span {
  color: #718093;
  line-height: 1.55;
}

.funnel-item small {
  display: block;
  margin-top: 2px;
  color: #718093;
  font-size: 0.76rem;
}

.opportunity-shell {
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.62fr);
}

.opportunity-stage-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.opportunity-stage-card,
.opportunity-agent-card,
.opportunity-action-item,
.opportunity-next-grid > div {
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(245, 249, 252, 0.88)),
    #ffffff;
  box-shadow: 0 16px 42px rgba(16, 32, 51, 0.06);
}

.opportunity-stage-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  min-height: 168px;
  padding: 15px;
  position: relative;
  overflow: hidden;
}

.opportunity-stage-card::after {
  content: "";
  position: absolute;
  inset: auto -22px -42px auto;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(18, 182, 203, 0.18), transparent 68%);
}

.opportunity-stage-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #12b6cb, #377cf6);
}

.opportunity-stage-card:nth-child(3n + 2) .opportunity-stage-index {
  background: linear-gradient(135deg, #7b61ff, #377cf6);
}

.opportunity-stage-card:nth-child(3n) .opportunity-stage-index {
  background: linear-gradient(135deg, #f59f38, #ef5f88);
}

.opportunity-stage-card span,
.opportunity-agent-card span,
.opportunity-next-grid span {
  color: #718093;
  font-size: 0.8rem;
  font-weight: 760;
}

.opportunity-stage-card strong,
.opportunity-agent-card strong,
.opportunity-next-grid strong,
.opportunity-action-item strong {
  color: #102033;
}

.opportunity-stage-card p,
.opportunity-agent-card p {
  margin: 8px 0 0;
  color: #516072;
  line-height: 1.55;
}

.opportunity-stage-card b {
  min-width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #08784c;
  background: rgba(232, 250, 242, 0.96);
}

.opportunity-agent-grid,
.opportunity-action-list {
  display: grid;
  gap: 10px;
}

.opportunity-agent-card {
  padding: 14px;
}

.opportunity-action-item {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  color: #102033;
  text-align: left;
}

.opportunity-action-item:hover {
  border-color: rgba(0, 151, 167, 0.28);
  background: rgba(232, 249, 252, 0.92);
}

.opportunity-action-item span,
.opportunity-action-item small {
  display: block;
  margin-top: 4px;
  color: #718093;
  line-height: 1.42;
}

.opportunity-action-item em {
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #2456d6;
  background: rgba(238, 244, 255, 0.96);
  font-style: normal;
  font-weight: 900;
}

.opportunity-funnel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.opportunity-funnel-card {
  position: relative;
  min-height: 116px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: start;
  padding: 13px;
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.opportunity-funnel-card > span,
.opportunity-funnel-card > b {
  min-width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  font-size: 0.78rem;
}

.opportunity-funnel-card > span { color: #2456d6; background: #eef4ff; }
.opportunity-funnel-card > b { color: #08784c; background: #e8faf2; }
.opportunity-funnel-card strong,
.opportunity-funnel-card small { display: block; }
.opportunity-funnel-card small { margin-top: 5px; color: #718093; font-size: 0.72rem; }
.opportunity-funnel-card i {
  position: absolute;
  inset: auto 0 0;
  height: 5px;
  background: linear-gradient(90deg, #12b6cb var(--funnel-rate), rgba(17, 24, 39, 0.07) var(--funnel-rate));
}

.opportunity-cycle-summary {
  display: grid;
  grid-template-columns: 180px 160px 1fr;
  gap: 10px;
  margin-top: 12px;
}

.opportunity-cycle-summary > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 8px;
  background: rgba(245, 249, 252, 0.92);
}

.opportunity-cycle-summary span { color: #718093; font-size: 0.75rem; }
.opportunity-cycle-summary strong { color: #102033; line-height: 1.45; }

.opportunity-work-list,
.suppression-list {
  display: grid;
  gap: 10px;
}

.opportunity-work-item,
.suppression-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(17, 24, 39, 0.09);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
}

.opportunity-work-head,
.suppression-item {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.opportunity-work-head { display: grid; gap: 10px; }
.opportunity-work-head strong,
.opportunity-work-head span,
.suppression-item strong,
.suppression-item span,
.suppression-item small { display: block; }
.opportunity-work-head span,
.suppression-item span,
.suppression-item small { margin-top: 4px; color: #718093; font-size: 0.76rem; line-height: 1.45; }
.opportunity-work-head em { color: #2456d6; font-style: normal; font-weight: 850; }
.opportunity-work-item p { margin: 0; color: #516072; line-height: 1.5; }

.opportunity-draft-preview {
  display: grid;
  gap: 6px;
  max-height: 138px;
  overflow: auto;
  padding: 10px;
  border-radius: 7px;
  background: #f5f9fc;
}
.opportunity-draft-preview span { white-space: pre-wrap; color: #516072; font-size: 0.78rem; line-height: 1.5; }

.reply-requirement-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.reply-requirement-tags span {
  padding: 5px 8px;
  border-radius: 999px;
  color: #2456d6;
  background: #eef4ff;
  font-size: 0.72rem;
}

.suppression-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(260px, 1.4fr) auto;
  gap: 10px;
  margin-bottom: 14px;
}
.suppression-form input,
.suppression-form select {
  min-height: 40px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: #fff;
  color: #102033;
}

.opportunity-detail-card {
  display: grid;
  gap: 14px;
  background:
    linear-gradient(135deg, rgba(238, 244, 255, 0.92), rgba(232, 250, 242, 0.9)),
    #ffffff;
}

.opportunity-next-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.opportunity-next-grid > div {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
}

.opportunity-record-card {
  display: grid;
  gap: 18px;
}

.opportunity-collapsible {
  display: block;
  padding: 0;
  overflow: hidden;
}

.opportunity-collapsible-summary {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 76px;
  padding: 16px 52px 16px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.opportunity-collapsible-summary::-webkit-details-marker {
  display: none;
}

.opportunity-collapsible-summary::after {
  content: "";
  position: absolute;
  right: 20px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid #718093;
  border-bottom: 2px solid #718093;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 160ms ease;
}

.opportunity-collapsible[open] > .opportunity-collapsible-summary::after {
  transform: translateY(-30%) rotate(225deg);
}

.opportunity-collapsible-summary h3 {
  margin: 3px 0 0;
}

.opportunity-collapse-state {
  padding: 6px 10px;
  border: 1px solid rgba(17, 24, 39, 0.1);
  border-radius: 999px;
  background: rgba(245, 249, 252, 0.9);
  color: #516072;
  font-size: 0.75rem;
  font-weight: 760;
  white-space: nowrap;
}

.opportunity-collapsible-body {
  display: grid;
  gap: 18px;
  padding: 16px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.opportunity-record-toolbar > span {
  color: #718093;
  font-size: 0.78rem;
}

.opportunity-timeline-body {
  padding-top: 4px;
}

.opportunity-record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.opportunity-record-grid label,
.opportunity-notes-label {
  display: grid;
  gap: 7px;
  color: #516072;
  font-size: 0.78rem;
  font-weight: 760;
}

.opportunity-record-grid label.span-2 {
  grid-column: span 2;
}

.opportunity-record-grid input,
.opportunity-record-grid select,
.opportunity-record-grid textarea,
.opportunity-notes-label textarea {
  width: 100%;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 8px;
  padding: 10px 11px;
  color: #102033;
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  resize: vertical;
}

.opportunity-subsection {
  display: grid;
  gap: 12px;
  padding-top: 15px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.opportunity-timeline-list {
  display: grid;
  gap: 9px;
  margin-top: 0;
}

.opportunity-timeline-item {
  display: grid;
  grid-template-columns: 145px 1fr;
  gap: 14px;
  align-items: start;
  padding: 11px 12px;
  border-left: 3px solid #377cf6;
  border-radius: 0 8px 8px 0;
  background: rgba(245, 249, 252, 0.9);
}

.opportunity-timeline-item.type-reply,
.opportunity-timeline-item.type-wake {
  border-left-color: #15a66d;
}

.opportunity-timeline-item.type-bounce,
.opportunity-timeline-item.type-unsubscribe {
  border-left-color: #ef5f68;
}

.opportunity-timeline-item > span,
.opportunity-timeline-item small {
  color: #718093;
  font-size: 0.76rem;
}

.opportunity-timeline-item div {
  display: grid;
  gap: 4px;
}

.opportunity-timeline-item small {
  line-height: 1.45;
}

@keyframes routePulse {
  to {
    stroke-dashoffset: -84;
  }
}

@media (max-width: 1380px) {
  .atlas-status-stack {
    grid-template-columns: 1fr;
  }

  .workspace:has(#dashboardView.active) .atlas-workgrid,
  .workspace:has(#dashboardView.active) .atlas-intel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace:has(#dashboardView.active) .tracking-panel,
  .workspace:has(#dashboardView.active) .priority-panel {
    grid-column: span 2;
  }

  .atlas-flow {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .atlas-flow > div::after {
    display: none;
  }
}

@media (max-width: 1120px) {
  .atlas-hero,
  .atlas-topology,
  .opportunity-shell,
  .workspace:has(#dashboardView.active) .atlas-workgrid,
  .workspace:has(#dashboardView.active) .atlas-intel-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-stage-board,
  .opportunity-next-grid {
    grid-template-columns: 1fr;
  }

  .opportunity-funnel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .suppression-form { grid-template-columns: 1fr 1fr; }
  .opportunity-cycle-summary { grid-template-columns: 1fr 1fr; }
  .opportunity-cycle-summary .wide { grid-column: span 2; }

  .opportunity-record-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workspace:has(#dashboardView.active) .tracking-panel,
  .workspace:has(#dashboardView.active) .priority-panel {
    grid-column: auto;
  }

  .atlas-hero-copy {
    background: linear-gradient(135deg, rgba(14, 27, 43, 0.96), rgba(18, 57, 79, 0.94));
  }
}

@media (max-width: 680px) {
  .workspace:has(#dashboardView.active) .main {
    padding: 14px;
  }

  .atlas-hero-copy {
    padding: 18px;
  }

  .atlas-status-stack,
  .atlas-mini-metrics,
  .signal-strip,
  .opportunity-stage-board,
  .opportunity-next-grid,
  .opportunity-funnel-grid,
  .opportunity-cycle-summary,
  .suppression-form,
  .opportunity-record-grid,
  .atlas-flow {
    grid-template-columns: 1fr !important;
  }

  .opportunity-cycle-summary .wide { grid-column: auto; }

  .opportunity-record-grid label.span-2 {
    grid-column: auto;
  }

  .opportunity-timeline-item {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .atlas-map svg {
    min-height: 250px;
  }
}

/* One-screen overview dashboard */
@media (min-width: 1180px) {
  .workspace:has(#dashboardView.active) {
    height: 100vh;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .main {
    height: 100vh;
    overflow: hidden;
    padding: 14px 18px;
  }

  .workspace:has(#dashboardView.active) .sidebar {
    min-height: 100vh;
  }

  .workspace:has(#dashboardView.active) .atlas-command {
    height: calc(100vh - 28px);
    max-width: none;
    grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.18fr);
    grid-template-areas:
      "hero hero"
      "kpi kpi"
      "map work"
      "lower lower";
    grid-template-rows: 84px 114px minmax(0, 1fr) 188px;
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero {
    grid-area: hero;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy {
    min-height: 84px;
    padding: 13px 18px;
    background:
      linear-gradient(108deg, rgba(14, 27, 43, 0.96) 0%, rgba(18, 57, 79, 0.94) 56%, rgba(255, 255, 255, 0.86) 56.3%, rgba(255, 255, 255, 0.86) 100%);
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    margin: 2px 0 5px;
    font-size: clamp(1.75rem, 2.55vw, 2.65rem);
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    max-width: 640px;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions {
    position: absolute;
    right: 18px;
    bottom: 14px;
    margin: 0;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn,
  .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link {
    min-height: 32px;
    height: 32px;
    padding: 0 12px;
    font-size: 0.82rem;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link {
    color: #244057;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(36, 64, 87, 0.16);
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 84px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    min-height: 0;
    padding: 9px 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack span {
    font-size: 0.68rem;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack strong {
    font-size: 0.82rem;
    line-height: 1.15;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card,
  .workspace:has(#dashboardView.active) .atlas-flow-panel,
  .workspace:has(#dashboardView.active) .market-panel,
  .workspace:has(#dashboardView.active) .template-panel,
  .workspace:has(#dashboardView.active) .tracking-panel,
  .workspace:has(#dashboardView.active) .risk-panel {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-topology {
    display: contents;
  }

  .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-area: kpi;
    height: 114px;
    display: grid;
    grid-template-columns: minmax(160px, 0.78fr) minmax(0, 3.8fr);
    gap: 10px;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: transparent;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card {
    grid-area: map;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    height: 100%;
    padding: 12px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map-head {
    min-height: 38px;
    margin-bottom: 8px;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map-head h3 {
    font-size: 1rem;
    line-height: 1.15;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map {
    height: 100%;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map svg {
    height: 100%;
    min-height: 0;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip {
    display: none;
  }

  .workspace:has(#dashboardView.active) .hero-metric {
    height: 114px;
    min-height: 114px;
    padding: 13px 15px;
  }

  .workspace:has(#dashboardView.active) .hero-metric strong {
    font-size: clamp(2.3rem, 3.3vw, 3.6rem);
  }

  .workspace:has(#dashboardView.active) .hero-metric small {
    font-size: 0.76rem;
    line-height: 1.2;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    height: 114px;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
    min-height: 114px;
    justify-content: center;
    gap: 7px;
    padding: 12px 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel strong {
    font-size: 1.65rem !important;
  }

  .workspace:has(#dashboardView.active) .command-main-grid {
    grid-area: work;
    min-height: 0;
    grid-template-columns: minmax(0, 1.18fr) minmax(250px, 0.72fr);
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .command-activity-panel {
    display: none;
  }

  .workspace:has(#dashboardView.active) .command-chart-panel,
  .workspace:has(#dashboardView.active) .command-activity-panel,
  .workspace:has(#dashboardView.active) .running-task-panel {
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .panel {
    padding: 12px;
  }

  .workspace:has(#dashboardView.active) .panel-header {
    min-height: 42px;
    margin-bottom: 8px;
    padding-bottom: 8px;
  }

  .workspace:has(#dashboardView.active) .panel-header h3 {
    font-size: 1rem;
  }

  .workspace:has(#dashboardView.active) .trend-chart {
    min-height: 0;
    height: calc(100% - 52px);
    padding: 8px;
  }

  .workspace:has(#dashboardView.active) .trend-chart svg {
    height: calc(100% - 26px);
    min-height: 170px;
  }

  .workspace:has(#dashboardView.active) .activity-feed,
  .workspace:has(#dashboardView.active) .running-task-panel .task-stream {
    max-height: calc(100% - 54px);
    overflow: auto;
  }

  .workspace:has(#dashboardView.active) .activity-feed div,
  .workspace:has(#dashboardView.active) .today-action-item {
    min-height: 50px;
    padding: 9px 10px;
  }

  .workspace:has(#dashboardView.active) .running-task-panel .empty-state {
    min-height: 100%;
    display: grid;
    place-content: center;
    gap: 8px;
    padding: 12px;
    text-align: center;
  }

  .workspace:has(#dashboardView.active) .task-item {
    padding: 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-intel-grid {
    grid-area: lower;
    min-height: 0;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.72fr) minmax(260px, 0.68fr);
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .priority-panel,
  .workspace:has(#dashboardView.active) .source-board-panel,
  .workspace:has(#dashboardView.active) .pipeline-panel {
    display: block;
    min-height: 0;
    height: 188px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .priority-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .workspace:has(#dashboardView.active) .priority-table-head {
    min-height: 26px;
    padding: 0 9px;
    font-size: 0.7rem;
  }

  .workspace:has(#dashboardView.active) .priority-panel .priority-list {
    max-height: 104px;
    overflow: auto;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command {
    min-height: 100%;
    height: 104px;
    align-content: center;
    gap: 6px;
    padding: 12px 14px;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command strong {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command span {
    display: -webkit-box;
    max-height: 2.7em;
    overflow: hidden;
    font-size: 0.76rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .workspace:has(#dashboardView.active) .priority-item {
    min-height: 42px;
    padding: 8px 9px;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(2),
  .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(4),
  .workspace:has(#dashboardView.active) .priority-item > div:first-child span,
  .workspace:has(#dashboardView.active) .priority-meta small {
    display: none;
  }

  .workspace:has(#dashboardView.active) .source-board {
    height: 126px;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .donut-card {
    min-height: 0;
  }

  .workspace:has(#dashboardView.active) .donut-ring {
    width: 96px;
  }

  .workspace:has(#dashboardView.active) .donut-ring strong {
    font-size: 1.45rem;
  }

  .workspace:has(#dashboardView.active) .source-board-panel .insight-list,
  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-list {
    max-height: 126px;
    overflow: auto;
  }

  .workspace:has(#dashboardView.active) .insight-item,
  .workspace:has(#dashboardView.active) .funnel-item {
    padding: 8px 9px;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-list {
    gap: 6px;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item {
    min-height: 34px;
    grid-template-columns: minmax(0, 1fr) 26px;
    gap: 8px;
    padding: 7px 9px;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item span,
  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item strong {
    font-size: 0.78rem;
    line-height: 1.15;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item small {
    display: none;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item .progress-track {
    height: 5px;
    margin-top: 5px;
  }

  .workspace:has(#dashboardView.active) .source-board-panel .empty-compact {
    min-height: 96px;
    display: grid;
    place-items: center;
    border: 1px dashed rgba(30, 91, 127, 0.16);
    border-radius: 8px;
    color: #718093;
    background: rgba(248, 250, 252, 0.72);
    font-weight: 850;
  }
}

@media (min-width: 1180px) and (max-height: 820px) {
  .workspace:has(#dashboardView.active) .atlas-command {
    grid-template-rows: 72px 104px minmax(0, 1fr) 188px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy,
  .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 72px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy {
    padding: 10px 16px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    margin: 0;
    font-size: clamp(1.75rem, 2.35vw, 2.08rem);
    line-height: 1.05;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions {
    right: 16px;
    bottom: 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    padding: 7px 10px;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack span {
    font-size: 0.64rem;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack strong {
    font-size: 0.76rem;
  }

  .workspace:has(#dashboardView.active) .atlas-kpi-panel,
  .workspace:has(#dashboardView.active) .hero-metric,
  .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    height: 104px;
  }

  .workspace:has(#dashboardView.active) .hero-metric {
    min-height: 104px;
    padding: 11px 14px;
  }

  .workspace:has(#dashboardView.active) .hero-metric strong {
    font-size: 2.12rem;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
    min-height: 104px;
    padding: 10px 8px;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel strong {
    font-size: 1.42rem !important;
  }

  .workspace:has(#dashboardView.active) .panel-header {
    min-height: 38px;
    margin-bottom: 7px;
    padding-bottom: 7px;
  }

  .workspace:has(#dashboardView.active) .trend-chart {
    height: calc(100% - 48px);
  }
}

/* Executive overview v2: reference-style one-screen dashboard */
@media (min-width: 1024px) {
  .workspace:has(#dashboardView.active) {
    height: 100vh;
    grid-template-columns: 220px minmax(0, 1fr);
    overflow: hidden;
    background:
      linear-gradient(rgba(38, 109, 151, 0.04) 1px, transparent 1px),
      linear-gradient(90deg, rgba(38, 109, 151, 0.04) 1px, transparent 1px),
      linear-gradient(135deg, #f8fbff 0%, #eef6fb 52%, #f8f8f4 100%);
    background-size: 24px 24px, 24px 24px, auto;
  }

  .workspace:has(#dashboardView.active) .sidebar {
    min-height: 100vh;
    padding: 14px 10px;
    gap: 14px;
  }

  .workspace:has(#dashboardView.active) .sidebar-brand {
    min-height: 50px;
    padding: 0 4px;
  }

  .workspace:has(#dashboardView.active) .grouped-nav {
    gap: 10px;
  }

  .workspace:has(#dashboardView.active) .nav-section {
    gap: 2px;
  }

  .workspace:has(#dashboardView.active) .nav-section p {
    margin: 5px 8px 2px;
    font-size: 0.68rem;
  }

  .workspace:has(#dashboardView.active) .nav-btn {
    min-height: 34px;
    padding: 6px 8px;
    grid-template-columns: 22px 1fr;
    font-size: 0.82rem;
    border-radius: 7px;
  }

  .workspace:has(#dashboardView.active) .nav-btn span {
    width: 20px;
    height: 20px;
  }

  .workspace:has(#dashboardView.active) .sidebar-status {
    padding: 10px;
  }

  .workspace:has(#dashboardView.active) .main {
    height: 100vh;
    padding: 10px 12px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .topbar {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-command {
    height: calc(100vh - 20px);
    max-width: none;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-template-rows: 54px 82px minmax(0, 1fr) minmax(0, 1fr) 150px;
    grid-template-areas:
      "hero hero hero hero hero hero hero hero hero hero hero hero"
      "kpi kpi kpi kpi kpi kpi kpi kpi kpi kpi kpi kpi"
      "chart chart chart chart map map map map map activity activity activity"
      "chart chart chart chart map map map map map tasks tasks tasks"
      "priority priority priority priority priority source source source source pipeline pipeline pipeline";
    gap: 8px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .atlas-topology,
  .workspace:has(#dashboardView.active) .command-main-grid,
  .workspace:has(#dashboardView.active) .atlas-intel-grid {
    display: contents;
  }

  .workspace:has(#dashboardView.active) .atlas-hero {
    grid-area: hero;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.32fr);
    gap: 8px;
    min-height: 0;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy,
  .workspace:has(#dashboardView.active) .atlas-status-stack,
  .workspace:has(#dashboardView.active) .metric-panel,
  .workspace:has(#dashboardView.active) .atlas-visual-card,
  .workspace:has(#dashboardView.active) .panel {
    border: 1px solid rgba(42, 68, 94, 0.09);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
      0 12px 32px rgba(34, 75, 109, 0.075),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy {
    min-height: 54px;
    display: grid;
    align-content: center;
    padding: 7px 14px;
    overflow: hidden;
    color: #0f2236;
    background:
      linear-gradient(90deg, rgba(37, 99, 235, 0.1), rgba(18, 182, 203, 0.08), rgba(255, 255, 255, 0.9));
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy::after {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy .eyebrow {
    color: #0f91a8;
    font-size: 0.64rem;
    line-height: 1;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    margin: 2px 0 0;
    color: #102033;
    font-size: clamp(1.24rem, 1.8vw, 1.56rem);
    line-height: 1.08;
    letter-spacing: 0;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions {
    position: absolute;
    right: 12px;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    margin: 0;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn,
  .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link {
    min-height: 30px;
    height: 30px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 54px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    min-height: 0;
    align-content: center;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.72);
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack span {
    font-size: 0.6rem;
    line-height: 1.05;
  }

  .workspace:has(#dashboardView.active) .atlas-status-stack strong {
    font-size: 0.72rem;
    line-height: 1.1;
  }

  .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-area: kpi;
    height: 82px;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    display: contents !important;
  }

  .workspace:has(#dashboardView.active) .hero-metric,
  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
    height: 82px;
    min-height: 82px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center;
    gap: 3px;
    padding: 9px 10px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .hero-metric {
    color: #ffffff;
    background: linear-gradient(135deg, #15334d 0%, #0f7d98 100%) !important;
  }

  .workspace:has(#dashboardView.active) .metric-panel span,
  .workspace:has(#dashboardView.active) .metric-panel small {
    max-width: 100%;
    margin: 0;
    overflow: visible;
    color: #718093;
    font-size: 0.7rem;
    line-height: 1.15;
    text-overflow: clip;
    white-space: nowrap;
  }

  .workspace:has(#dashboardView.active) .metric-panel small {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .workspace:has(#dashboardView.active) .hero-metric span,
  .workspace:has(#dashboardView.active) .hero-metric small {
    color: rgba(255, 255, 255, 0.76);
  }

  .workspace:has(#dashboardView.active) .metric-panel strong {
    margin: 0;
    color: #102033;
    font-size: clamp(1.28rem, 1.7vw, 1.68rem) !important;
    line-height: 1;
  }

  .workspace:has(#dashboardView.active) .hero-metric strong {
    color: #ffffff;
    font-size: clamp(1.58rem, 2.2vw, 2rem) !important;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card {
    grid-area: map;
    display: grid;
    grid-template-rows: 38px auto auto;
    align-content: start;
    height: 100%;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .atlas-map-head,
  .workspace:has(#dashboardView.active) .panel-header {
    min-height: 34px;
    margin: 0 0 6px;
    padding: 0 0 6px;
    align-items: center;
  }

  .workspace:has(#dashboardView.active) .atlas-map-head h3,
  .workspace:has(#dashboardView.active) .panel-header h3 {
    font-size: 0.92rem;
    line-height: 1.12;
  }

  .workspace:has(#dashboardView.active) .eyebrow {
    font-size: 0.64rem;
    line-height: 1.05;
  }

  .workspace:has(#dashboardView.active) .atlas-map {
    height: auto;
    aspect-ratio: 900 / 420;
    border-radius: 7px;
    background:
      linear-gradient(180deg, rgba(232, 246, 255, 0.78), rgba(255, 255, 255, 0.92)),
      radial-gradient(circle at 52% 42%, rgba(18, 182, 203, 0.16), transparent 54%);
  }

  .workspace:has(#dashboardView.active) .atlas-map svg {
    width: 100%;
    height: 100%;
    max-width: none;
    min-height: 0;
    transform: none;
  }

  .workspace:has(#dashboardView.active) .atlas-labels text {
    font-size: 15px;
  }

  .workspace:has(#dashboardView.active) .atlas-map-legend {
    display: none;
  }

  .workspace:has(#dashboardView.active) .signal-strip,
  .workspace:has(#dashboardView.active) .atlas-flow-panel,
  .workspace:has(#dashboardView.active) .market-panel,
  .workspace:has(#dashboardView.active) .template-panel,
  .workspace:has(#dashboardView.active) .tracking-panel,
  .workspace:has(#dashboardView.active) .risk-panel {
    display: none;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip span {
    min-height: 28px;
    padding: 0 8px;
    border-radius: 8px;
    color: #244057;
    font-size: 0.68rem;
    font-weight: 900;
    background:
      linear-gradient(135deg, rgba(18, 182, 203, 0.1), rgba(55, 124, 246, 0.06)),
      rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(18, 83, 120, 0.09);
  }

  .workspace:has(#dashboardView.active) .command-chart-panel {
    grid-area: chart;
  }

  .workspace:has(#dashboardView.active) .command-activity-panel {
    grid-area: activity;
    display: block;
  }

  .workspace:has(#dashboardView.active) .running-task-panel {
    grid-area: tasks;
  }

  .workspace:has(#dashboardView.active) .priority-panel {
    grid-area: priority;
  }

  .workspace:has(#dashboardView.active) .source-board-panel {
    grid-area: source;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel {
    grid-area: pipeline;
  }

  .workspace:has(#dashboardView.active) .command-chart-panel,
  .workspace:has(#dashboardView.active) .command-activity-panel,
  .workspace:has(#dashboardView.active) .running-task-panel,
  .workspace:has(#dashboardView.active) .priority-panel,
  .workspace:has(#dashboardView.active) .source-board-panel,
  .workspace:has(#dashboardView.active) .pipeline-panel {
    height: 100%;
    min-height: 0;
    padding: 10px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .trend-chart {
    height: calc(100% - 40px);
    min-height: 0;
    padding: 7px;
  }

  .workspace:has(#dashboardView.active) .trend-chart svg {
    height: calc(100% - 22px);
    min-height: 0;
  }

  .workspace:has(#dashboardView.active) .chart-legend {
    gap: 10px;
    font-size: 0.72rem;
  }

  .workspace:has(#dashboardView.active) .activity-feed,
  .workspace:has(#dashboardView.active) .running-task-panel .task-stream {
    max-height: calc(100% - 40px);
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .activity-feed {
    gap: 6px;
  }

  .workspace:has(#dashboardView.active) .activity-feed div,
  .workspace:has(#dashboardView.active) .today-action-item {
    min-height: 0;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(55, 124, 246, 0.08), rgba(18, 182, 203, 0.04)),
      rgba(255, 255, 255, 0.78);
  }

  .workspace:has(#dashboardView.active) .today-action-item {
    grid-template-columns: 28px minmax(0, 1fr) 14px;
  }

  .workspace:has(#dashboardView.active) .activity-feed b {
    width: 26px;
    height: 26px;
    font-size: 0.66rem;
  }

  .workspace:has(#dashboardView.active) .activity-feed span {
    display: block;
    overflow: hidden;
    font-size: 0.78rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace:has(#dashboardView.active) .activity-feed small {
    display: block;
    overflow: hidden;
    font-size: 0.68rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace:has(#dashboardView.active) .running-task-panel .empty-state {
    height: calc(100% - 42px);
    min-height: 0;
    display: grid;
    place-content: center;
    gap: 6px;
    padding: 8px;
    text-align: center;
  }

  .workspace:has(#dashboardView.active) .empty-state strong {
    font-size: 0.95rem;
  }

  .workspace:has(#dashboardView.active) .empty-state span {
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-card {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 10px;
    min-height: 66px;
    padding: 8px;
    border: 1px solid rgba(37, 99, 235, 0.11);
    border-radius: 8px;
    background:
      linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(245, 159, 56, 0.07)),
      rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
  }

  .workspace:has(#dashboardView.active) .dashboard-task-index {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    align-self: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #12b6cb, #2867ff);
    font-weight: 900;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-main {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-topline {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-topline strong {
    display: block;
    overflow: hidden;
    color: #102033;
    font-size: 0.88rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-main p,
  .workspace:has(#dashboardView.active) .dashboard-task-main small {
    margin: 0;
    overflow: hidden;
    color: #718093;
    font-size: 0.72rem;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-main small {
    display: none;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 8px;
    align-items: center;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-progress .progress-track {
    height: 7px;
  }

  .workspace:has(#dashboardView.active) .dashboard-task-progress span {
    color: #244057;
    font-size: 0.72rem;
    font-weight: 900;
    text-align: right;
  }

  .workspace:has(#dashboardView.active) .priority-table-head {
    min-height: 24px;
    grid-template-columns: minmax(0, 1fr) 52px;
    padding: 0 8px;
    font-size: 0.68rem;
  }

  .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(2),
  .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(4) {
    display: none;
  }

  .workspace:has(#dashboardView.active) .priority-panel .priority-list {
    max-height: 80px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command {
    height: 80px;
    min-height: 80px;
    gap: 5px;
    padding: 10px;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command strong {
    font-size: 0.84rem;
  }

  .workspace:has(#dashboardView.active) .priority-panel .empty-command span {
    font-size: 0.72rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .workspace:has(#dashboardView.active) .priority-item {
    min-height: 38px;
    grid-template-columns: minmax(0, 1fr) 42px;
    padding: 7px 8px;
  }

  .workspace:has(#dashboardView.active) .source-board {
    height: calc(100% - 40px);
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 8px;
  }

  .workspace:has(#dashboardView.active) .donut-ring {
    width: 78px;
  }

  .workspace:has(#dashboardView.active) .donut-ring strong {
    font-size: 1.15rem;
  }

  .workspace:has(#dashboardView.active) .source-board-panel .insight-list,
  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-list {
    max-height: 92px;
    overflow: hidden;
  }

  .workspace:has(#dashboardView.active) .source-board-panel .empty-compact {
    min-height: 76px;
    font-size: 0.78rem;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-list {
    gap: 5px;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item {
    min-height: 26px;
    grid-template-columns: minmax(0, 1fr) 22px;
    padding: 5px 7px;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item span,
  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item strong {
    font-size: 0.7rem;
  }

  .workspace:has(#dashboardView.active) .pipeline-panel .funnel-item .progress-track {
    height: 4px;
    margin-top: 4px;
  }
}

@media (min-width: 1024px) and (max-height: 680px) {
  .workspace:has(#dashboardView.active) .atlas-command {
    grid-template-rows: 48px 74px minmax(0, 1fr) minmax(0, 1fr) 132px;
    gap: 7px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy,
  .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 48px;
  }

  .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    font-size: 1.18rem;
  }

  .workspace:has(#dashboardView.active) .atlas-kpi-panel,
  .workspace:has(#dashboardView.active) .hero-metric,
  .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
    height: 74px;
    min-height: 74px;
  }

  .workspace:has(#dashboardView.active) .metric-panel strong {
    font-size: 1.18rem !important;
  }

  .workspace:has(#dashboardView.active) .hero-metric strong {
    font-size: 1.5rem !important;
  }

  .workspace:has(#dashboardView.active) .command-chart-panel,
  .workspace:has(#dashboardView.active) .command-activity-panel,
  .workspace:has(#dashboardView.active) .running-task-panel,
  .workspace:has(#dashboardView.active) .priority-panel,
  .workspace:has(#dashboardView.active) .source-board-panel,
  .workspace:has(#dashboardView.active) .pipeline-panel,
  .workspace:has(#dashboardView.active) .atlas-visual-card {
    padding: 8px;
  }
}

body:has(#authShell:not([hidden])) {
  color: #0f1e2d;
  background:
    linear-gradient(rgba(24, 52, 78, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(24, 52, 78, 0.045) 1px, transparent 1px),
    linear-gradient(118deg, rgba(9, 42, 76, 0.08), transparent 38%),
    linear-gradient(142deg, transparent 48%, rgba(20, 183, 200, 0.12) 48.2%, rgba(52, 120, 255, 0.1) 72%, transparent 72.2%),
    linear-gradient(135deg, #f9fbff 0%, #eef8fb 50%, #fff8f0 100%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(390px, 0.78fr);
  gap: clamp(18px, 2.2vw, 34px);
  align-items: center;
  padding: clamp(24px, 3vw, 44px);
  position: relative;
  z-index: 1;
}

.auth-visual-panel,
.auth-card {
  border: 1px solid rgba(26, 56, 82, 0.1);
  border-radius: 16px;
  box-shadow: 0 28px 90px rgba(25, 52, 82, 0.13);
  backdrop-filter: blur(18px);
}

.auth-visual-panel {
  min-height: min(760px, calc(100vh - 72px));
  padding: clamp(28px, 3.2vw, 48px);
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(124deg, rgba(9, 38, 70, 0.98) 0%, rgba(9, 93, 123, 0.94) 44%, rgba(248, 253, 255, 0.83) 44.2%, rgba(255, 248, 239, 0.88) 100%),
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: auto, 36px 36px, 36px 36px;
}

.auth-visual-panel::after {
  content: "";
  position: absolute;
  inset: auto -12% -20% 42%;
  height: 48%;
  background: linear-gradient(135deg, rgba(255, 186, 88, 0.18), rgba(20, 183, 200, 0.16));
  transform: skewX(-18deg);
  pointer-events: none;
}

.auth-brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  max-width: 620px;
  color: #fff;
}

.auth-brand-lockup .brand-mark {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #23c6e8, #3678ff);
  box-shadow: 0 18px 42px rgba(25, 126, 235, 0.32);
}

.auth-brand-lockup h1 {
  max-width: 760px;
  font-size: clamp(2.55rem, 5.1vw, 5.45rem);
  line-height: 1.02;
  letter-spacing: 0;
  margin-bottom: 14px;
}

.auth-showcase {
  position: absolute;
  right: clamp(22px, 3vw, 46px);
  top: 27%;
  width: min(67vw, 790px);
  max-width: calc(100% - 48px);
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(240, 251, 255, 0.88)),
    linear-gradient(rgba(32, 84, 116, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 84, 116, 0.08) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: 0 34px 90px rgba(10, 61, 97, 0.24);
  overflow: hidden;
  z-index: 2;
}

.auth-showcase-topbar,
.auth-showcase-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
}

.auth-showcase-topbar {
  border-bottom: 1px solid rgba(26, 56, 82, 0.08);
}

.auth-showcase-topbar span,
.auth-showcase-footer span {
  color: #0d9aac;
  font-size: 0.76rem;
  font-weight: 920;
  text-transform: uppercase;
}

.auth-showcase-topbar strong,
.auth-showcase-footer strong {
  color: #102033;
  font-size: 0.92rem;
}

.auth-showcase-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 154px;
  gap: 14px;
  padding: 16px;
}

.auth-preview-map {
  position: relative;
  min-height: 278px;
  border: 1px solid rgba(26, 56, 82, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(rgba(31, 83, 119, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 83, 119, 0.07) 1px, transparent 1px),
    linear-gradient(135deg, #eefaff, #fff8ef);
  background-size: 42px 42px, 42px 42px, auto;
  overflow: hidden;
}

.map-continent {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.82);
  filter: drop-shadow(0 18px 32px rgba(29, 80, 115, 0.12));
}

.continent-one {
  left: 7%;
  top: 22%;
  width: 31%;
  height: 29%;
  border-radius: 50% 44% 52% 46%;
  background: linear-gradient(135deg, rgba(58, 204, 227, 0.74), rgba(37, 152, 255, 0.38));
}

.continent-two {
  left: 43%;
  top: 16%;
  width: 38%;
  height: 35%;
  border-radius: 48% 44% 52% 46%;
  background: linear-gradient(135deg, rgba(127, 102, 255, 0.52), rgba(255, 186, 87, 0.44));
}

.continent-three {
  left: 35%;
  bottom: 10%;
  width: 23%;
  height: 32%;
  border-radius: 45% 50% 44% 54%;
  background: linear-gradient(135deg, rgba(42, 207, 138, 0.62), rgba(20, 183, 200, 0.24));
}

.map-route {
  position: absolute;
  height: 3px;
  border-radius: 999px;
  transform-origin: left center;
}

.route-one {
  left: 21%;
  top: 43%;
  width: 48%;
  transform: rotate(-4deg);
  background: repeating-linear-gradient(90deg, #18b7c8 0 12px, transparent 12px 21px);
}

.route-two {
  left: 50%;
  top: 54%;
  width: 34%;
  transform: rotate(25deg);
  background: repeating-linear-gradient(90deg, #f4a033 0 12px, transparent 12px 21px);
}

.map-node {
  position: absolute;
  width: 17px;
  height: 17px;
  border: 4px solid #15b6c6;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 6px rgba(20, 183, 200, 0.1);
}

.node-source {
  left: 66%;
  top: 50%;
  background: #102033;
  border-color: #f4a033;
}

.node-eu {
  left: 56%;
  top: 34%;
}

.node-us {
  left: 20%;
  top: 39%;
}

.node-au {
  left: 81%;
  top: 67%;
}

.map-label {
  position: absolute;
  color: #21364a;
  font-size: 0.86rem;
  font-weight: 920;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.82);
}

.label-source {
  left: 70%;
  top: 49%;
}

.label-eu {
  left: 51%;
  top: 25%;
}

.label-us {
  left: 14%;
  top: 29%;
}

.label-au {
  left: 75%;
  top: 78%;
}

.auth-preview-side {
  display: grid;
  gap: 10px;
}

.auth-preview-stat {
  min-height: 82px;
  border: 1px solid rgba(26, 56, 82, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
  display: grid;
  align-content: center;
  box-shadow: inset 4px 0 0 var(--accent);
}

.auth-preview-stat span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

.auth-preview-stat strong {
  color: #102033;
  font-size: 1.75rem;
}

.accent-cyan {
  --accent: #12b7c8;
}

.accent-blue {
  --accent: #3478ff;
}

.accent-green {
  --accent: #18b889;
}

.auth-showcase-footer {
  padding-top: 0;
}

.auth-showcase-footer div {
  flex: 1;
  border: 1px solid rgba(26, 56, 82, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
}

.auth-brand-lockup span {
  display: block;
  color: rgba(255, 255, 255, 0.76);
  font-size: 1.06rem;
  line-height: 1.7;
}

.auth-command-map {
  width: min(68vw, 780px);
  max-width: calc(100% - 42px);
  position: absolute;
  right: clamp(18px, 3vw, 42px);
  top: 28%;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(239, 250, 255, 0.84)),
    linear-gradient(rgba(17, 84, 115, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 84, 115, 0.08) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: 0 30px 90px rgba(11, 74, 112, 0.22);
}

.auth-map-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 15px 18px 0;
}

.auth-map-head span {
  color: #0795a7;
  font-weight: 900;
  font-size: 0.78rem;
}

.auth-map-head strong {
  color: #102033;
  font-size: 0.9rem;
}

.auth-command-map svg {
  display: block;
  width: 100%;
  height: auto;
  padding: 2px 16px 18px;
}

.auth-land {
  fill: rgba(35, 198, 232, 0.24);
  stroke: rgba(18, 114, 150, 0.16);
  stroke-width: 2;
}

.auth-land.land-b {
  fill: rgba(255, 174, 64, 0.26);
}

.auth-land.land-c {
  fill: rgba(41, 207, 138, 0.22);
}

.auth-route {
  fill: none;
  stroke: url(#authRoute);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 12 12;
}

.auth-route.alt {
  stroke: #14b889;
}

.auth-route.warm {
  stroke: #f49b26;
}

.auth-node {
  fill: #fff;
  stroke: #14b7c8;
  stroke-width: 5;
}

.auth-node.source {
  fill: #102033;
  stroke: #f49b26;
}

.auth-command-map text {
  fill: #21364a;
  font-size: 20px;
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.88);
  stroke-width: 5px;
}

.auth-signal-row {
  position: absolute;
  left: clamp(28px, 3.2vw, 48px);
  right: clamp(28px, 3.2vw, 48px);
  bottom: 154px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.auth-signal-row div {
  min-height: 78px;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px);
}

.auth-signal-row span,
.auth-signal-row strong {
  display: block;
}

.auth-signal-row span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  margin-bottom: 7px;
}

.auth-signal-row strong {
  color: #fff;
  font-size: 1rem;
}

.auth-proof-grid {
  position: absolute;
  left: clamp(28px, 3.2vw, 48px);
  right: clamp(28px, 3.2vw, 48px);
  bottom: clamp(28px, 3.2vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.auth-proof-grid div {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(12px);
}

.auth-proof-grid strong,
.auth-proof-grid span,
.auth-proof-grid small {
  display: block;
}

.auth-proof-grid div > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #102033;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 920;
}

.auth-proof-grid strong {
  margin-bottom: 6px;
  font-size: 1.08rem;
}

.auth-proof-grid small {
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.45;
}

.auth-card {
  align-self: center;
  padding: clamp(22px, 2.4vw, 32px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(248, 252, 255, 0.92)),
    rgba(255, 255, 255, 0.94);
  color: #102033;
}

.auth-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 10px;
  border: 1px solid rgba(20, 183, 200, 0.2);
  border-radius: 999px;
  color: #067b8f;
  background: rgba(20, 183, 200, 0.08);
  font-size: 0.82rem;
  font-weight: 850;
}

.auth-card-head {
  margin-bottom: 17px;
}

.auth-card-head h2 {
  font-size: clamp(1.85rem, 2.7vw, 2.35rem);
  line-height: 1.06;
  color: #102033;
}

.auth-card-head span {
  display: block;
  margin-top: 8px;
  color: #64748b;
  line-height: 1.48;
  font-size: 0.95rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 15px;
  border: 1px solid rgba(132, 160, 184, 0.28);
  border-radius: 14px;
  background: #f3f7fb;
}

.auth-tabs button {
  border: 0;
  border-radius: 11px;
  padding: 10px;
  color: #64748b;
  background: transparent;
  font-weight: 800;
}

.auth-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #19b6cf, #3678ff);
  box-shadow: 0 12px 28px rgba(41, 130, 240, 0.22);
}

.auth-form {
  display: grid;
  gap: 11px;
}

.auth-form label {
  color: #52657a;
  font-weight: 780;
  font-size: 0.92rem;
}

.auth-form input,
.auth-device-strip {
  color: #102033;
  background: rgba(248, 251, 254, 0.92);
  border-color: rgba(132, 160, 184, 0.3);
}

.auth-form input {
  min-height: 48px;
  margin-top: 6px;
  border-radius: 12px;
}

.auth-card .primary-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border-radius: 13px;
  font-size: 1rem;
}

.auth-security-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 12px;
}

.auth-security-row span {
  min-height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(20, 183, 200, 0.16);
  border-radius: 10px;
  color: #087f8f;
  background: rgba(20, 183, 200, 0.06);
  font-size: 0.76rem;
  font-weight: 850;
  text-align: center;
}

.auth-device-strip {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(132, 160, 184, 0.28);
  border-radius: 12px;
}

.auth-device-strip span {
  color: #64748b;
  font-size: 0.78rem;
}

.auth-device-strip code {
  color: #0f8aa0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}

.sidebar-account {
  display: grid;
  gap: 5px;
  padding: 14px;
  margin-top: auto;
  border: 1px solid rgba(142, 165, 151, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-account span,
.sidebar-account small {
  color: var(--muted);
  font-size: 0.78rem;
}

.sidebar-account strong {
  color: var(--text);
}

.sidebar-account .ghost-btn {
  min-height: 32px;
  margin-top: 6px;
  padding: 6px 10px;
  font-size: 0.82rem;
}

.admin-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.admin-hero-panel {
  grid-column: 1 / -1;
}

.admin-license-panel {
  grid-column: 1 / 5;
}

.admin-order-panel {
  grid-column: 5 / -1;
}

.admin-users-panel,
.admin-audit-panel {
  grid-column: 1 / 7;
}

.admin-license-list-panel,
.admin-reset-panel {
  grid-column: 7 / -1;
}

.admin-hero-panel {
  display: grid;
  gap: 16px;
}

.admin-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-metric-card {
  padding: 16px;
  border: 1px solid rgba(72, 216, 223, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(72, 216, 223, 0.12), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.03);
}

.admin-metric-card span,
.admin-metric-card small {
  display: block;
  color: var(--muted);
}

.admin-metric-card strong {
  display: block;
  margin: 8px 0;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1;
}

.admin-system-card strong {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  overflow-wrap: anywhere;
}

.admin-system-strip {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.admin-system-header {
  margin-bottom: 12px;
}

.admin-system-grid .admin-metric-card {
  padding: 14px;
}

.admin-system-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-system-meta strong {
  color: var(--text);
}

.admin-license-form {
  display: grid;
  gap: 12px;
}

.admin-license-form label small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.admin-license-form textarea,
.license-code-view textarea,
#licenseInput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-x: hidden;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  word-break: break-all;
}

.compact-form-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.inline-check input {
  width: auto;
}

.field-disabled {
  opacity: 0.52;
}

.field-disabled input {
  cursor: not-allowed;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 960px;
}

.admin-table th,
.admin-table td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.82rem;
}

.admin-table td {
  color: var(--text);
}

.admin-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.admin-table code {
  color: var(--cyan);
  white-space: normal;
  overflow-wrap: anywhere;
}

.admin-status-btn {
  border: 1px solid rgba(72, 216, 223, 0.22);
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.admin-status-btn.success {
  border-color: rgba(118, 224, 160, 0.34);
  color: var(--green);
}

.admin-status-btn.danger {
  border-color: rgba(255, 113, 141, 0.36);
  color: var(--rose);
}

.admin-collapse-panel {
  padding: 0;
  overflow: hidden;
}

.admin-collapse-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 18px;
  cursor: pointer;
  list-style: none;
}

.admin-collapse-summary::-webkit-details-marker {
  display: none;
}

.admin-collapse-summary .admin-collapse-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(72, 216, 223, 0.22);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(72, 216, 223, 0.08);
  font-size: 0.8rem;
  font-weight: 800;
}

.admin-collapse-summary .is-open,
.admin-collapse-panel[open] .admin-collapse-summary .is-closed {
  display: none;
}

.admin-collapse-panel[open] .admin-collapse-summary .is-open {
  display: inline;
}

.admin-collapse-panel > .admin-table-wrap,
.admin-collapse-panel > .admin-license-list {
  margin: 0 18px 18px;
}

.status-pill.success {
  color: #0f8b5f;
  border-color: rgba(34, 185, 129, 0.34);
  background: rgba(34, 185, 129, 0.08);
}

.status-pill.danger {
  color: #b4233d;
  border-color: rgba(220, 38, 70, 0.28);
  background: rgba(220, 38, 70, 0.08);
}

.status-pill.muted {
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.24);
  background: rgba(100, 116, 139, 0.08);
}

.status-pill.status-contacted {
  color: #ffffff;
  border-color: rgba(16, 185, 129, 0.86);
  background: linear-gradient(135deg, #0f9f72, #18c78f);
  box-shadow: 0 8px 18px rgba(15, 159, 114, 0.18);
}

.admin-license-list {
  display: grid;
  gap: 10px;
}

.admin-order-list {
  display: grid;
  gap: 10px;
}

.admin-order-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-order-item.pending {
  border-color: rgba(245, 159, 56, 0.3);
  background: rgba(245, 159, 56, 0.07);
}

.admin-order-item strong,
.admin-order-item span,
.admin-order-item small {
  display: block;
}

.admin-order-item span,
.admin-order-item small {
  margin-top: 4px;
  color: var(--muted);
}

.admin-order-action {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-license-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-license-item strong,
.admin-license-item span,
.admin-license-item small {
  display: block;
}

.admin-license-item span,
.admin-license-item small {
  margin-top: 4px;
  color: var(--muted);
}

.admin-license-item .ghost-btn {
  align-self: center;
  min-height: 34px;
  padding: 7px 12px;
}

.admin-reset-list {
  display: grid;
  gap: 10px;
}

.admin-reset-item {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.admin-reset-item.pending {
  border-color: rgba(47, 123, 255, 0.22);
  background: rgba(47, 123, 255, 0.05);
}

.admin-reset-item strong,
.admin-reset-item span,
.admin-reset-item small {
  display: block;
}

.admin-reset-item span,
.admin-reset-item small {
  margin-top: 4px;
  color: var(--muted);
}

.admin-reset-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.admin-reset-password-input {
  min-height: 38px;
  border-radius: 8px;
}

.admin-front-link {
  display: inline-flex;
  justify-content: center;
  margin-top: 14px;
  color: #0f8aa0;
  font-weight: 800;
  text-decoration: none;
}

.admin-workspace .main {
  padding-bottom: 28px;
}

.admin-console-sidebar {
  background:
    linear-gradient(180deg, rgba(7, 12, 20, 0.96), rgba(11, 21, 31, 0.92)),
    linear-gradient(rgba(72, 216, 223, 0.06) 1px, transparent 1px);
}

.admin-open-front {
  text-decoration: none;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .auth-visual-panel {
    min-height: auto;
    display: grid;
    gap: 16px;
  }

  .auth-showcase {
    position: static;
    width: 100%;
    max-width: none;
  }

  .auth-showcase-body {
    grid-template-columns: 1fr;
  }

  .auth-preview-side,
  .auth-showcase-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .auth-signal-row {
    position: static;
    grid-template-columns: 1fr;
  }

  .auth-proof-grid {
    position: static;
    grid-template-columns: 1fr;
  }

  .auth-security-row {
    grid-template-columns: 1fr;
  }

  .auth-proof-grid,
  .admin-layout,
  .admin-metric-grid,
  .compact-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero-panel,
  .admin-users-panel,
  .admin-license-panel,
  .admin-order-panel,
  .admin-license-list-panel,
  .admin-reset-panel,
  .admin-audit-panel {
    grid-column: auto;
  }
}

@media (min-width: 981px) and (max-height: 760px) {
  .auth-shell {
    padding: 18px 28px;
  }

  .auth-visual-panel {
    min-height: calc(100vh - 48px);
  }

  .auth-brand-lockup h1 {
    font-size: clamp(2.2rem, 4.6vw, 4.4rem);
  }

  .auth-showcase {
    top: 25%;
    width: min(60vw, 680px);
  }

  .auth-showcase-body {
    grid-template-columns: minmax(0, 1fr) 132px;
    padding: 12px;
  }

  .auth-preview-map {
    min-height: 235px;
  }

  .auth-preview-stat {
    min-height: 66px;
    padding: 9px;
  }

  .auth-showcase-topbar,
  .auth-showcase-footer {
    padding: 10px 12px;
  }

  .auth-signal-row {
    bottom: 132px;
  }

  .auth-signal-row div {
    min-height: 62px;
    padding: 11px;
  }

  .auth-proof-grid div {
    padding: 12px;
  }
}

/* Commercial mode: calm static visuals reduce browser repaint flicker. */
.activation-visual::after,
.radar span:nth-child(2),
.radar-core i,
.pulse-dot,
.atlas-routes path {
  animation: none !important;
}

.pulse-dot {
  box-shadow: 0 0 0 4px rgba(118, 224, 160, 0.14);
}

.atlas-routes path {
  stroke-dashoffset: 0;
}

.task-item.task-monitor {
  grid-template-columns: 48px minmax(0, 1fr) 132px;
  align-items: stretch;
  gap: 18px;
  padding: 18px;
}

.task-monitor-main {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.task-monitor-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.task-monitor-head > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.task-monitor-head strong {
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  line-height: 1.25;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-monitor-head span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-stage-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.task-stage-line span,
.task-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.task-stage-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.task-evidence-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(82px, 1fr));
  gap: 8px;
}

.task-evidence-grid div {
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 81, 111, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.68);
}

.task-evidence-grid small,
.task-evidence-grid strong {
  display: block;
}

.task-evidence-grid small {
  color: var(--muted);
  font-size: 0.78rem;
}

.task-evidence-grid strong {
  margin-top: 5px;
  color: var(--text);
  font-size: 1.05rem;
}

.task-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mission-list.is-collapsed .task-stepper {
  max-height: 67px;
  overflow: hidden;
}

.mission-list.is-collapsed .task-command {
  max-height: 44px;
  overflow: hidden;
}

.task-stepper span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 9px 5px 6px;
  border: 1px solid rgba(31, 81, 111, 0.12);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.64);
  font-size: 0.78rem;
  white-space: nowrap;
}

.task-stepper i {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 138, 160, 0.1);
  color: #0f8aa0;
  font-style: normal;
  font-size: 0.72rem;
  font-weight: 850;
}

.task-stepper span.done {
  border-color: rgba(34, 197, 94, 0.18);
  color: #0f7a4d;
}

.task-stepper span.done i {
  background: rgba(34, 197, 94, 0.16);
  color: #0f7a4d;
}

.task-stepper span.current {
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.08);
}

.task-stepper span.current i {
  background: linear-gradient(135deg, #1aa0d6, #3d6df2);
  color: white;
}

.task-monitor-side {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: center;
}

.task-progress-ring {
  --value: calc(var(--progress) * 1%);
  width: 104px;
  height: 104px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#1aa0d6 0 var(--value), rgba(31, 81, 111, 0.12) var(--value) 100%);
  box-shadow: inset 0 0 0 1px rgba(31, 81, 111, 0.08), 0 10px 24px rgba(31, 81, 111, 0.08);
}

.task-progress-ring strong,
.task-progress-ring span {
  grid-area: 1 / 1;
}

.task-progress-ring strong {
  margin-top: -10px;
  color: var(--text);
  font-size: 1.3rem;
}

.task-progress-ring span {
  margin-top: 32px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.task-monitor.done .task-progress-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#16a34a 0 var(--value), rgba(31, 81, 111, 0.12) var(--value) 100%);
}

.task-monitor.failed .task-progress-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(#dc2626 0 var(--value), rgba(31, 81, 111, 0.12) var(--value) 100%);
}

.mailbox-switcher {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(31, 81, 111, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.mailbox-preset-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 138, 160, 0.16);
  border-radius: 12px;
  color: #65758a;
  background: rgba(230, 250, 252, 0.58);
  font-size: 0.92rem;
}

.mailbox-preset-row span {
  min-width: 0;
}

.checkbox-line {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  color: var(--text);
  font-weight: 750;
}

.checkbox-line input {
  width: 18px;
  height: 18px;
}

#mailSenderCount[readonly] {
  color: #0f8aa0;
  background: rgba(15, 138, 160, 0.08);
  font-weight: 850;
}

@media (max-width: 900px) {
  .task-item.task-monitor {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .task-monitor-side {
    grid-column: 2;
    justify-items: start;
  }

  .task-evidence-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mailbox-switcher {
    grid-template-columns: 1fr;
  }

  .mailbox-preset-row {
    align-items: stretch;
    flex-direction: column;
  }

  .help-hero,
  .help-grid,
  .help-two-column {
    grid-template-columns: 1fr;
  }

  .help-hero h3 {
    font-size: 1.7rem;
  }
}

/* Login v2: full-screen premium SaaS entry inspired by modern product login pages. */
body:has(#authShell:not([hidden])) {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(118deg, #092640 0%, #0a5368 45%, #eef8fb 45.1%, #fff8ed 100%);
  background-size: 36px 36px, 36px 36px, auto;
}

body:has(#authShell:not([hidden]))::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(132deg, rgba(255, 255, 255, 0.08) 0 34%, transparent 34.2%),
    linear-gradient(108deg, transparent 52%, rgba(20, 183, 200, 0.16) 52.2%, rgba(255, 176, 76, 0.12) 74%, transparent 74.2%);
  pointer-events: none;
}

.auth-shell {
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(390px, 440px);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
  padding: clamp(24px, 4.2vw, 64px);
}

.auth-visual-panel {
  min-height: calc(100vh - clamp(48px, 8.4vw, 128px));
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  overflow: visible;
  display: grid;
  align-content: center;
  gap: clamp(22px, 3vw, 34px);
}

.auth-visual-panel::after {
  display: none;
}

.auth-brand-lockup {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  max-width: 760px;
}

.auth-brand-lockup .brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22);
}

.auth-brand-lockup h1 {
  max-width: 720px;
  margin: 2px 0 16px;
  font-size: clamp(3.4rem, 6.4vw, 7.1rem);
  line-height: 0.95;
  color: #fff;
  text-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.auth-brand-lockup .eyebrow {
  color: #6ef4ff;
}

.auth-brand-lockup span {
  max-width: 560px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1rem, 1.25vw, 1.18rem);
}

.auth-showcase {
  position: relative;
  top: auto;
  right: auto;
  z-index: 3;
  width: min(780px, 88%);
  max-width: none;
  margin-left: clamp(16px, 5vw, 72px);
  transform: rotate(-2.4deg);
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(235, 251, 255, 0.78)),
    linear-gradient(rgba(23, 86, 118, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 86, 118, 0.08) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: 0 42px 100px rgba(3, 30, 52, 0.34);
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
  pointer-events: none;
}

.auth-showcase-topbar {
  padding: 16px 18px 8px;
}

.auth-showcase-body {
  grid-template-columns: minmax(0, 1fr) 142px;
  gap: 12px;
  padding: 14px 18px;
}

.auth-preview-map {
  min-height: 260px;
  border-radius: 18px;
}

.auth-preview-stat {
  min-height: 76px;
  border-radius: 16px;
}

.auth-showcase-footer {
  padding: 0 18px 18px;
}

.auth-showcase-footer div {
  border-radius: 15px;
}

.auth-proof-grid {
  position: relative;
  inset: auto;
  z-index: 4;
  width: min(780px, 88%);
  margin-left: clamp(16px, 5vw, 72px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.auth-proof-grid div {
  min-height: 112px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.auth-proof-grid div > span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #102033;
  background: rgba(255, 255, 255, 0.86);
  font-size: 0.76rem;
  font-weight: 920;
}

.auth-proof-grid small {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.auth-card {
  position: relative;
  z-index: 5;
  width: 100%;
  align-self: center;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.64);
  box-shadow: 0 44px 120px rgba(26, 56, 82, 0.24);
  backdrop-filter: blur(26px);
  padding: clamp(28px, 3vw, 42px);
}

.auth-card-badge {
  color: #075f73;
  background: rgba(20, 183, 200, 0.12);
  border-radius: 999px;
}

.auth-card-head h2 {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
}

.auth-tabs {
  border-radius: 999px;
  background: rgba(237, 246, 250, 0.92);
}

.auth-tabs button {
  border-radius: 999px;
}

.auth-form input,
.auth-device-strip {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.auth-card .primary-btn {
  border-radius: 16px;
  background: linear-gradient(135deg, #10b6c8, #3478ff);
  box-shadow: 0 18px 36px rgba(52, 120, 255, 0.24);
}

.auth-security-row span {
  border-radius: 999px;
  background: rgba(20, 183, 200, 0.08);
}

@media (max-width: 980px) {
  body:has(#authShell:not([hidden])) {
    background:
      linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      linear-gradient(180deg, #092640 0%, #0b5368 44%, #eff9fb 44.1%, #fff8ed 100%);
    background-size: 34px 34px, 34px 34px, auto;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .auth-visual-panel {
    min-height: auto;
  }

  .auth-brand-lockup {
    grid-template-columns: 1fr;
  }

  .auth-brand-lockup h1 {
    font-size: clamp(2.8rem, 14vw, 4.5rem);
  }

  .auth-showcase,
  .auth-proof-grid {
    width: 100%;
    margin-left: 0;
    transform: none;
  }

  .auth-showcase-body,
  .auth-proof-grid {
    grid-template-columns: 1fr;
  }

  .auth-preview-side,
  .auth-showcase-footer {
    display: grid;
    grid-template-columns: 1fr;
  }
}

@media (min-width: 981px) and (max-height: 760px) {
  .auth-shell {
    padding: 18px 30px;
  }

  .auth-brand-lockup h1 {
    font-size: clamp(2.8rem, 5.2vw, 5rem);
  }

  .auth-showcase {
    width: min(690px, 86%);
  }

  .auth-preview-map {
    min-height: 210px;
  }

  .auth-preview-stat {
    min-height: 60px;
  }

  .auth-proof-grid div {
    min-height: 86px;
    padding: 12px;
  }

  .auth-card {
    padding: 24px;
  }
}

/* Login v3: premium command-center entry. */
html:has(#authShell:not([hidden])),
body:has(#authShell:not([hidden])) {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body:has(#authShell:not([hidden])) {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  overflow: hidden;
  background:
    linear-gradient(rgba(18, 64, 94, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 64, 94, 0.07) 1px, transparent 1px),
    linear-gradient(120deg, #edf8ff 0%, #f8fcff 48%, #fff6ea 100%);
  background-size: 42px 42px, 42px 42px, auto;
}

body:has(#authShell:not([hidden])) .app-frame {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
}

html:has(#bootScreen:not([hidden])),
body:has(#bootScreen:not([hidden])) {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body:has(#bootScreen:not([hidden])) {
  position: fixed;
  inset: 0;
  min-height: 100dvh;
  background:
    linear-gradient(rgba(18, 64, 94, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(18, 64, 94, 0.07) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(0, 190, 214, 0.16), transparent 34%),
    linear-gradient(120deg, #edf8ff 0%, #f8fcff 52%, #fff6ea 100%);
  background-size: 42px 42px, 42px 42px, auto, auto;
}

body:has(#bootScreen:not([hidden])) .app-frame {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
}

.boot-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 48px;
  color: #0f1d2b;
}

.boot-card {
  width: min(520px, 100%);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 30px;
  border: 1px solid rgba(44, 68, 94, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 28px 90px rgba(50, 86, 124, 0.18);
  backdrop-filter: blur(18px);
}

.boot-card h1 {
  margin: 2px 0 6px;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.boot-card span {
  color: #637287;
}

.boot-progress {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf3;
}

.boot-progress i {
  display: block;
  width: 44%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #11bfd3, #2f6bff, #f2a32b);
  animation: boot-progress 1.1s ease-in-out infinite alternate;
}

@keyframes boot-progress {
  from {
    transform: translateX(-18%);
  }
  to {
    transform: translateX(142%);
  }
}

.auth-shell {
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(420px, 0.82fr);
  gap: 0;
  padding: 0;
  background:
    linear-gradient(102deg, rgba(12, 44, 70, 0.08) 0 11%, transparent 11.2%),
    linear-gradient(118deg, transparent 0 66%, rgba(255, 255, 255, 0.62) 66.2% 100%);
  overflow: hidden;
  isolation: isolate;
}

.auth-visual-panel {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  max-height: 100dvh;
  display: grid;
  align-content: space-between;
  gap: clamp(18px, 3vh, 30px);
  padding: clamp(32px, 5vw, 76px) clamp(40px, 6.2vw, 92px);
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(115deg, rgba(0, 202, 224, 0.32), transparent 38%),
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(135deg, #051d34 0%, #0a4159 52%, #1298a9 100%);
  background-size: auto, 38px 38px, 38px 38px, auto;
  clip-path: polygon(0 0, 92% 0, 78% 100%, 0 100%);
  box-shadow: 38px 0 80px rgba(17, 76, 103, 0.24);
}

.auth-visual-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 44%, rgba(255, 255, 255, 0.2) 44.2% 44.8%, transparent 45%),
    linear-gradient(118deg, transparent 0 62%, rgba(255, 214, 154, 0.46) 62.1% 62.5%, transparent 62.7%);
  opacity: 0.9;
  pointer-events: none;
}

.auth-visual-panel::after {
  content: "";
  position: absolute;
  left: clamp(34px, 7vw, 96px);
  right: clamp(140px, 20vw, 340px);
  bottom: 8%;
  height: 1px;
  display: block;
  background: linear-gradient(90deg, rgba(103, 239, 255, 0), rgba(103, 239, 255, 0.72), rgba(255, 197, 112, 0));
  box-shadow: 0 0 36px rgba(83, 222, 255, 0.55);
}

.auth-brand-lockup {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  max-width: 850px;
}

.auth-brand-lockup .brand-mark {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  background: linear-gradient(135deg, #16c7d9, #3478ff 58%, #7d5cff);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.28);
  font-size: 1.28rem;
}

.auth-brand-lockup .eyebrow {
  margin-top: 5px;
  color: #8ff7ff;
  font-weight: 900;
}

.auth-brand-lockup h1 {
  max-width: 800px;
  margin: 0 0 18px;
  color: #ffffff;
  font-size: clamp(4rem, 7vw, 7.6rem);
  line-height: 0.96;
  text-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
}

.auth-brand-lockup span {
  display: block;
  max-width: 620px;
  color: rgba(236, 252, 255, 0.86);
  font-size: clamp(1.08rem, 1.35vw, 1.26rem);
  line-height: 1.75;
}

.auth-showcase {
  position: relative;
  z-index: 2;
  width: min(790px, 76%);
  max-width: none;
  margin: 0 0 clamp(36px, 5vh, 68px) clamp(20px, 5vw, 80px);
  transform: perspective(980px) rotateY(-10deg) rotateX(2deg) rotate(-1.2deg);
  transform-origin: left center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(225, 248, 255, 0.76)),
    linear-gradient(rgba(13, 85, 113, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(13, 85, 113, 0.08) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  box-shadow: 0 48px 120px rgba(0, 14, 31, 0.42);
}

.auth-showcase::before {
  content: "LIVE";
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 3;
  padding: 7px 12px;
  border-radius: 999px;
  color: #076a45;
  background: rgba(224, 255, 239, 0.92);
  border: 1px solid rgba(46, 209, 132, 0.36);
  font-size: 0.74rem;
  font-weight: 900;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 21px;
  pointer-events: none;
}

.auth-showcase-topbar {
  padding: 18px 20px 8px;
}

.auth-showcase-topbar span,
.auth-showcase-footer span {
  color: #0b91a5;
}

.auth-showcase-body {
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 14px;
  padding: 14px 20px;
}

.auth-preview-map {
  min-height: 300px;
  border-radius: 20px;
  background:
    linear-gradient(rgba(50, 117, 158, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 117, 158, 0.09) 1px, transparent 1px),
    linear-gradient(135deg, rgba(232, 249, 255, 0.96), rgba(255, 247, 235, 0.92));
  background-size: 54px 54px, 54px 54px, auto;
}

.auth-preview-side {
  gap: 12px;
}

.auth-preview-stat {
  min-height: 82px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(113, 168, 190, 0.22);
}

.auth-showcase-footer {
  padding: 0 20px 20px;
}

.auth-showcase-footer div {
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.8);
}

.auth-proof-grid {
  position: absolute;
  z-index: 4;
  left: clamp(36px, 5vw, 84px);
  bottom: clamp(24px, 3.8vh, 48px);
  width: min(620px, 44vw);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.auth-proof-grid div {
  min-height: 112px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 22px 54px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(14px);
}

.auth-proof-grid div > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 9px;
  border-radius: 9px;
  color: #062137;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.74rem;
  font-weight: 950;
}

.auth-proof-grid strong {
  display: block;
  margin-bottom: 4px;
}

.auth-proof-grid small {
  color: rgba(237, 252, 255, 0.78);
  line-height: 1.5;
}

.auth-card {
  position: relative;
  z-index: 5;
  width: min(472px, calc(100% - 70px));
  align-self: center;
  justify-self: center;
  margin: 0 clamp(26px, 5vw, 78px) 0 0;
  padding: clamp(30px, 4vw, 48px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.76)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 46px 130px rgba(28, 64, 92, 0.24);
  backdrop-filter: blur(24px);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 6px;
  background: linear-gradient(90deg, #10b6c8, #3478ff, #7b5cff, #f2a12e);
}

.auth-card-badge {
  width: max-content;
  padding: 9px 13px;
  border: 1px solid rgba(22, 190, 210, 0.24);
  border-radius: 999px;
  color: #075f73;
  background: rgba(20, 183, 200, 0.1);
  font-weight: 900;
}

.auth-card-head {
  margin-top: 18px;
}

.auth-card-head h2 {
  margin: 4px 0 10px;
  color: #0c1b2a;
  font-size: clamp(2.35rem, 4.1vw, 3.35rem);
  line-height: 1.03;
}

.auth-card-head span {
  color: #617286;
  line-height: 1.65;
}

.auth-tabs {
  padding: 5px;
  border: 1px solid rgba(80, 126, 150, 0.14);
  border-radius: 999px;
  background: rgba(237, 247, 252, 0.9);
}

.auth-tabs button {
  min-height: 46px;
  border-radius: 999px;
  color: #526a7d;
  font-weight: 900;
}

.auth-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #123f63, #157c91 54%, #2d7cff);
  box-shadow: 0 12px 26px rgba(38, 116, 255, 0.22);
}

.auth-form {
  margin-top: 22px;
  gap: 16px;
}

.auth-form label {
  color: #56687a;
  font-weight: 850;
}

.auth-form input {
  min-height: 56px;
  margin-top: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.auth-form input:focus {
  border-color: rgba(21, 169, 190, 0.72);
  box-shadow: 0 0 0 4px rgba(21, 169, 190, 0.14);
}

.auth-card .primary-btn {
  min-height: 58px;
  margin-top: 4px;
  border-radius: 18px;
  background: linear-gradient(135deg, #0db7c8, #2f7bff 62%, #7b5cff);
  box-shadow: 0 20px 42px rgba(47, 123, 255, 0.26);
}

.auth-challenge-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  align-items: end;
  gap: 10px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(21, 169, 190, 0.18);
  border-radius: 18px;
  background: rgba(233, 249, 252, 0.7);
}

.auth-challenge-panel span,
.auth-reset-form label {
  display: block;
  color: #617286;
  font-weight: 850;
}

.auth-challenge-panel strong {
  display: block;
  margin-top: 4px;
  color: #0f2235;
  font-size: 1.05rem;
}

.auth-challenge-panel label {
  margin: 0;
}

.auth-challenge-panel input {
  min-height: 44px;
  margin-top: 0;
  border-radius: 14px;
}

.security-hidden-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.auth-secondary-action {
  justify-self: start;
  margin-top: 12px;
  padding: 0;
  border: 0;
  color: #2563eb;
  background: transparent;
  font-weight: 850;
}

.auth-reset-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 18px;
  background: rgba(247, 250, 255, 0.86);
}

.auth-reset-form[hidden] {
  display: none;
}

.auth-reset-form input {
  min-height: 48px;
  margin-top: 8px;
  border-radius: 14px;
}

.auth-security-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.auth-security-row span {
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  color: #537082;
  background: rgba(21, 169, 190, 0.08);
}

.auth-device-strip {
  border-radius: 18px;
  background: rgba(248, 252, 255, 0.9);
}

@media (min-width: 981px) and (max-height: 790px) {
  .auth-visual-panel {
    min-height: 100dvh;
    padding-top: 24px;
    padding-bottom: 24px;
    gap: 14px;
  }

  .auth-brand-lockup h1 {
    font-size: clamp(3rem, 5vw, 5.2rem);
  }

  .auth-brand-lockup span {
    font-size: 1rem;
    line-height: 1.48;
  }

  .auth-showcase {
    width: min(640px, 72%);
    margin-bottom: 18px;
  }

  .auth-preview-map {
    min-height: 170px;
  }

  .auth-showcase-topbar {
    padding: 12px 16px 4px;
  }

  .auth-showcase-body {
    grid-template-columns: minmax(0, 1fr) 122px;
    gap: 10px;
    padding: 10px 16px;
  }

  .auth-preview-stat {
    min-height: 52px;
    padding: 10px;
  }

  .auth-preview-stat strong {
    font-size: 1.5rem;
  }

  .auth-showcase-footer {
    padding: 0 16px 14px;
    gap: 8px;
  }

  .auth-proof-grid {
    display: none;
  }

  .auth-card {
    max-height: calc(100dvh - 28px);
    padding: 20px 24px;
    overflow: hidden;
  }

  .auth-card-badge {
    padding: 6px 10px;
  }

  .auth-card-head {
    margin-top: 12px;
  }

  .auth-card-head h2 {
    font-size: 2.18rem;
  }

  .auth-card-head span {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .auth-tabs {
    margin-top: 14px;
  }

  .auth-tabs button {
    min-height: 38px;
  }

  .auth-form {
    margin-top: 14px;
    gap: 10px;
  }

  .auth-form input {
    min-height: 44px;
    margin-top: 5px;
  }

  .auth-card .primary-btn {
    min-height: 48px;
  }

  .auth-security-row {
    display: none;
  }

  .auth-device-strip {
    margin-top: 10px;
    padding: 10px 12px;
  }
}

@media (max-width: 980px) {
  body:has(#authShell:not([hidden])) {
    overflow: hidden;
  }

  .auth-shell {
    grid-template-columns: 1fr;
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .auth-visual-panel {
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    clip-path: none;
    padding: clamp(16px, 3.2vh, 28px) 20px;
    align-content: start;
  }

  .auth-brand-lockup {
    grid-template-columns: 1fr;
  }

  .auth-brand-lockup h1 {
    font-size: clamp(2.4rem, 10vw, 4.2rem);
  }

  .auth-brand-lockup span {
    font-size: 0.95rem;
    line-height: 1.45;
  }

  .auth-showcase {
    width: 100%;
    margin: clamp(12px, 2vh, 18px) 0 0;
    transform: none;
  }

  .auth-showcase-body {
    grid-template-columns: 1fr;
  }

  .auth-preview-map {
    min-height: min(210px, 24vh);
  }

  .auth-preview-side,
  .auth-showcase-footer,
  .auth-proof-grid {
    display: none;
  }

  .auth-proof-grid {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .auth-card {
    position: absolute;
    right: 16px;
    bottom: 16px;
    width: min(430px, calc(100% - 32px));
    max-height: min(58dvh, 560px);
    margin: 0;
    padding: 18px;
    overflow: hidden;
  }

  .auth-card-head h2 {
    font-size: 2rem;
  }

  .auth-card-head span,
  .auth-security-row,
  .auth-device-strip {
    display: none;
  }

  .auth-form input {
    min-height: 44px;
  }

  .auth-card .primary-btn {
    min-height: 46px;
  }
}

/* Unified compact workspace scale: keep non-overview pages aligned with the overview density. */
@media (min-width: 1024px) {
  .workspace:not(:has(#dashboardView.active)) {
    font-size: 14px;
  }

  .workspace:not(:has(#dashboardView.active)) .sidebar {
    padding: 14px 10px;
    gap: 14px;
  }

  .workspace:not(:has(#dashboardView.active)) .sidebar-brand {
    min-height: 50px;
    padding: 0 4px;
  }

  .workspace:not(:has(#dashboardView.active)) .grouped-nav {
    gap: 10px;
  }

  .workspace:not(:has(#dashboardView.active)) .nav-section {
    gap: 2px;
  }

  .workspace:not(:has(#dashboardView.active)) .nav-section p {
    margin: 5px 8px 2px;
    font-size: 0.68rem;
  }

  .workspace:not(:has(#dashboardView.active)) .nav-btn {
    min-height: 36px;
    padding: 6px 8px;
    grid-template-columns: 24px 1fr;
    border-radius: 7px;
    font-size: 0.83rem;
  }

  .workspace:not(:has(#dashboardView.active)) .nav-btn span {
    width: 21px;
    height: 21px;
  }

  .workspace:not(:has(#dashboardView.active)) .sidebar-status,
  .workspace:not(:has(#dashboardView.active)) .sidebar-account {
    padding: 10px;
  }

  .workspace:not(:has(#dashboardView.active)) .main {
    padding: 12px 18px 28px;
  }

  .workspace:not(:has(#dashboardView.active)) .topbar {
    min-height: 68px;
    margin-bottom: 12px;
    padding: 12px 16px;
  }

  .workspace:not(:has(#dashboardView.active)) .topbar h2 {
    margin-top: 2px;
    font-size: clamp(1.24rem, 1.8vw, 1.56rem);
    line-height: 1.08;
  }

  .workspace:not(:has(#dashboardView.active)) .eyebrow {
    font-size: 0.66rem;
    line-height: 1.1;
  }

  .workspace:not(:has(#dashboardView.active)) .topbar-tools {
    gap: 8px;
  }

  .workspace:not(:has(#dashboardView.active)) .mini-stat {
    min-height: 46px;
    padding: 8px 10px;
  }

  .workspace:not(:has(#dashboardView.active)) .mini-stat span {
    font-size: 0.66rem;
  }

  .workspace:not(:has(#dashboardView.active)) .mini-stat strong {
    font-size: 0.92rem;
  }

  .workspace:not(:has(#dashboardView.active)) .dashboard-grid,
  .workspace:not(:has(#dashboardView.active)) .split-grid,
  .workspace:not(:has(#dashboardView.active)) .settings-grid,
  .workspace:not(:has(#dashboardView.active)) .keyword-engine-grid,
  .workspace:not(:has(#dashboardView.active)) .logic-grid {
    gap: 12px;
  }

  .workspace:not(:has(#dashboardView.active)) .panel,
  .workspace:not(:has(#dashboardView.active)) .metric-panel,
  .workspace:not(:has(#dashboardView.active)) .license-stat {
    border-radius: 8px;
  }

  .workspace:not(:has(#dashboardView.active)) .panel {
    padding: 14px;
  }

  .workspace:not(:has(#dashboardView.active)) .panel-header {
    min-height: 32px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    gap: 10px;
    align-items: center;
  }

  .workspace:not(:has(#dashboardView.active)) .panel-header h3 {
    font-size: 0.92rem;
    line-height: 1.15;
  }

  .workspace:not(:has(#dashboardView.active)) .panel-badge,
  .workspace:not(:has(#dashboardView.active)) .status-pill,
  .workspace:not(:has(#dashboardView.active)) .score-pill,
  .workspace:not(:has(#dashboardView.active)) .email-grade {
    min-height: 24px;
    padding: 0 8px;
    border-radius: 7px;
    font-size: 0.72rem;
  }

  .workspace:not(:has(#dashboardView.active)) .task-form,
  .workspace:not(:has(#dashboardView.active)) .writer-form,
  .workspace:not(:has(#dashboardView.active)) .settings-form {
    gap: 10px;
  }

  .workspace:not(:has(#dashboardView.active)) label,
  .workspace:not(:has(#dashboardView.active)) .field-block,
  .workspace:not(:has(#dashboardView.active)) .draft-subject-label {
    gap: 6px;
    font-size: 0.82rem;
  }

  .workspace:not(:has(#dashboardView.active)) input,
  .workspace:not(:has(#dashboardView.active)) select,
  .workspace:not(:has(#dashboardView.active)) textarea,
  .workspace:not(:has(#dashboardView.active)) .filterable-select-trigger {
    min-height: 38px;
    padding: 9px 11px;
    font-size: 0.88rem;
    border-radius: 8px;
  }

  .workspace:not(:has(#dashboardView.active)) textarea {
    line-height: 1.45;
  }

  .workspace:not(:has(#dashboardView.active)) .primary-btn,
  .workspace:not(:has(#dashboardView.active)) .ghost-btn {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 0.84rem;
  }

  .workspace:not(:has(#dashboardView.active)) .icon-btn {
    width: 36px;
    min-height: 36px;
  }

  .workspace:not(:has(#dashboardView.active)) .settings-helper,
  .workspace:not(:has(#dashboardView.active)) .task-item span,
  .workspace:not(:has(#dashboardView.active)) .mission-item span,
  .workspace:not(:has(#dashboardView.active)) .mail-queue-item span,
  .workspace:not(:has(#dashboardView.active)) .mail-queue-item small,
  .workspace:not(:has(#dashboardView.active)) .category-option small,
  .workspace:not(:has(#dashboardView.active)) .cost-preview span {
    font-size: 0.78rem;
    line-height: 1.42;
  }

  .workspace:not(:has(#dashboardView.active)) .task-item strong,
  .workspace:not(:has(#dashboardView.active)) .mission-item strong,
  .workspace:not(:has(#dashboardView.active)) .mail-queue-main strong,
  .workspace:not(:has(#dashboardView.active)) .table-company strong,
  .workspace:not(:has(#dashboardView.active)) .empty-state strong {
    font-size: 0.92rem;
    line-height: 1.22;
  }

  .workspace:not(:has(#dashboardView.active)) .task-item,
  .workspace:not(:has(#dashboardView.active)) .mission-item,
  .workspace:not(:has(#dashboardView.active)) .mail-queue-item,
  .workspace:not(:has(#dashboardView.active)) .category-option,
  .workspace:not(:has(#dashboardView.active)) .automation-stat,
  .workspace:not(:has(#dashboardView.active)) .keyword-section,
  .workspace:not(:has(#dashboardView.active)) .field-box,
  .workspace:not(:has(#dashboardView.active)) .contact-card,
  .workspace:not(:has(#dashboardView.active)) .identity-block {
    padding: 10px;
    border-radius: 8px;
  }

  .workspace:not(:has(#dashboardView.active)) .task-index {
    width: 30px;
    font-size: 0.82rem;
  }

  .workspace:not(:has(#dashboardView.active)) .automation-grid {
    gap: 8px;
  }

  .workspace:not(:has(#dashboardView.active)) .automation-stat strong {
    font-size: 1.08rem;
  }

  .workspace:not(:has(#dashboardView.active)) .table-wrap th,
  .workspace:not(:has(#dashboardView.active)) .table-wrap td {
    padding: 10px 11px;
  }

  .workspace:not(:has(#dashboardView.active)) .table-wrap td {
    font-size: 0.86rem;
  }

  .workspace:not(:has(#dashboardView.active)) .table-wrap th {
    font-size: 0.72rem;
  }

  .workspace:not(:has(#dashboardView.active)) .draft-box {
    min-height: 340px;
  }

  .workspace:not(:has(#dashboardView.active)) .mail-signature-form {
    gap: 10px;
  }
}

.workspace .th-filter select,
.workspace:not(:has(#dashboardView.active)) .th-filter select {
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 10px;
  color: transparent;
  font-size: 0;
  line-height: 1;
  text-indent: -999px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' stroke='%23506171' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.workspace .th-filter select option,
.workspace:not(:has(#dashboardView.active)) .th-filter select option {
  color: #14212b;
  font-size: 0.88rem;
  text-indent: 0;
}

.workspace .nav-btn.has-badge,
.workspace:has(#dashboardView.active) .nav-btn.has-badge,
.workspace:not(:has(#dashboardView.active)) .nav-btn.has-badge {
  grid-template-columns: 24px minmax(0, 1fr) auto;
}

@media (max-width: 980px) {
  .announcement-hero,
  .announcement-layout {
    grid-template-columns: 1fr;
  }

  .announcement-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

body[data-theme="dark"] {
  --bg: #050b12;
  --bg-2: #07111d;
  --panel: rgba(9, 18, 29, 0.9);
  --panel-strong: rgba(12, 22, 35, 0.98);
  --panel-soft: rgba(11, 24, 38, 0.9);
  --line: rgba(154, 178, 205, 0.16);
  --line-strong: rgba(0, 194, 203, 0.36);
  --text: #e8f1fb;
  --muted: #96a8bd;
  --dim: #6f8198;
  --cyan: #12c7c0;
  --green: #28d08a;
  --amber: #f3b14d;
  --rose: #ff6b78;
  --blue: #5b86ff;
  --violet: #9a78ff;
  --ink: #edf6ff;
  --executive-bg: #06101b;
  --executive-ink: #eef6ff;
  --executive-muted: #99aabd;
  color-scheme: dark;
  color: var(--text);
  background:
    linear-gradient(118deg, rgba(91, 134, 255, 0.1) 0 16%, transparent 16% 100%),
    linear-gradient(145deg, transparent 0 63%, rgba(18, 199, 192, 0.08) 63% 73%, transparent 73%),
    linear-gradient(180deg, #02070d 0%, #06101b 100%);
}

body[data-theme="dark"] .app-frame::before {
  background:
    linear-gradient(100deg, transparent 0 8%, rgba(91, 134, 255, 0.08) 8% 12%, transparent 12% 100%),
    linear-gradient(128deg, transparent 0 76%, rgba(18, 199, 192, 0.08) 76% 81%, transparent 81% 100%);
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .route-shell,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric-panel,
body[data-theme="dark"] .command-shell,
body[data-theme="dark"] .task-item,
body[data-theme="dark"] .mission-item,
body[data-theme="dark"] .mail-queue-item,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .detail-hero-card,
body[data-theme="dark"] .detail-empty-hero,
body[data-theme="dark"] .announcement-item,
body[data-theme="dark"] .announcement-hero,
body[data-theme="dark"] .announcement-side-card,
body[data-theme="dark"] .billing-plan-card,
body[data-theme="dark"] .billing-payment-card,
body[data-theme="dark"] .license-stat,
body[data-theme="dark"] .field-box,
body[data-theme="dark"] .profile-signal-card,
body[data-theme="dark"] .free-source-box,
body[data-theme="dark"] .keyword-engine-shell,
body[data-theme="dark"] .keyword-template-card,
body[data-theme="dark"] .keyword-output,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .data-table,
body[data-theme="dark"] .modal-card {
  border-color: rgba(154, 178, 205, 0.16);
  background: rgba(8, 17, 29, 0.88);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .sidebar {
  background:
    linear-gradient(180deg, rgba(8, 17, 29, 0.96), rgba(5, 12, 21, 0.92)),
    linear-gradient(120deg, rgba(18, 199, 192, 0.08), transparent 42%);
}

body[data-theme="dark"] .route-shell,
body[data-theme="dark"] .topbar {
  background: rgba(8, 17, 29, 0.86);
  backdrop-filter: blur(20px);
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] .sidebar-brand strong,
body[data-theme="dark"] .nav-btn.active,
body[data-theme="dark"] .nav-btn:hover,
body[data-theme="dark"] .route-brand,
body[data-theme="dark"] .route-group.active .route-group-btn,
body[data-theme="dark"] .route-tab.active,
body[data-theme="dark"] .table-company strong,
body[data-theme="dark"] .field-box strong,
body[data-theme="dark"] .mini-stat strong {
  color: #eef6ff;
}

body[data-theme="dark"] .eyebrow,
body[data-theme="dark"] .route-breadcrumbs,
body[data-theme="dark"] .route-group-btn,
body[data-theme="dark"] .route-menu button,
body[data-theme="dark"] .route-tab,
body[data-theme="dark"] .nav-btn,
body[data-theme="dark"] label,
body[data-theme="dark"] .settings-helper,
body[data-theme="dark"] .status-message,
body[data-theme="dark"] .empty-state,
body[data-theme="dark"] .empty-compact,
body[data-theme="dark"] .table-company span,
body[data-theme="dark"] .contact-card span,
body[data-theme="dark"] .contact-card small,
body[data-theme="dark"] .field-box span,
body[data-theme="dark"] .announcement-content p,
body[data-theme="dark"] .announcement-side-card span {
  color: var(--muted);
}

body[data-theme="dark"] .route-menu {
  border-color: rgba(154, 178, 205, 0.18);
  background: rgba(7, 16, 28, 0.98);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
}

body[data-theme="dark"] .route-brand,
body[data-theme="dark"] .route-group.active .route-group-btn,
body[data-theme="dark"] .route-group-btn:hover,
body[data-theme="dark"] .route-tab,
body[data-theme="dark"] .mini-stat,
body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .theme-toggle-btn,
body[data-theme="dark"] .empty-compact {
  border-color: rgba(154, 178, 205, 0.18);
  background: rgba(13, 27, 43, 0.82);
}

body[data-theme="dark"] .route-menu button:hover,
body[data-theme="dark"] .route-menu button.active,
body[data-theme="dark"] .route-tab.active,
body[data-theme="dark"] .nav-btn.active,
body[data-theme="dark"] .nav-btn:hover {
  background: linear-gradient(90deg, rgba(18, 199, 192, 0.16), rgba(91, 134, 255, 0.08));
}

body[data-theme="dark"] textarea,
body[data-theme="dark"] input,
body[data-theme="dark"] select {
  color: var(--text);
  color-scheme: dark;
  border-color: rgba(154, 178, 205, 0.2);
  background: rgba(3, 9, 16, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body[data-theme="dark"] textarea::placeholder,
body[data-theme="dark"] input::placeholder {
  color: rgba(150, 168, 189, 0.72);
}

body[data-theme="dark"] .data-table th,
body[data-theme="dark"] .data-table td,
body[data-theme="dark"] .lead-table th,
body[data-theme="dark"] .lead-table td {
  border-color: rgba(154, 178, 205, 0.12);
  background: rgba(8, 17, 29, 0.55);
}

body[data-theme="dark"] .data-table th,
body[data-theme="dark"] .lead-table th {
  color: #c9d8e8;
  background: rgba(13, 27, 43, 0.92);
}

body[data-theme="dark"] .primary-btn {
  box-shadow: 0 12px 26px rgba(18, 199, 192, 0.16);
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .icon-btn,
body[data-theme="dark"] .theme-toggle-btn {
  color: #dce8f5;
}

body[data-theme="dark"] .theme-toggle-btn {
  border-color: rgba(18, 199, 192, 0.34);
  background: linear-gradient(135deg, rgba(18, 199, 192, 0.18), rgba(91, 134, 255, 0.12));
}

body[data-theme="dark"] .announcement-date,
body[data-theme="dark"] .score-badge,
body[data-theme="dark"] .status-pill,
body[data-theme="dark"] .tag,
body[data-theme="dark"] .feature {
  border-color: rgba(18, 199, 192, 0.22);
  background: rgba(18, 199, 192, 0.1);
}

body[data-theme="dark"] .workspace .th-filter select option,
body[data-theme="dark"] .workspace:not(:has(#dashboardView.active)) .th-filter select option {
  color: #e8f1fb;
  background: #07111d;
}

body[data-theme="dark"] .workspace {
  color: #e8f1fb;
  background:
    linear-gradient(125deg, rgba(18, 199, 192, 0.08) 0 1px, transparent 1px 100%),
    linear-gradient(180deg, #050c15 0%, #07111d 100%);
}

body[data-theme="dark"] .workspace:has(#dashboardView.active),
body[data-theme="dark"] .workspace:has(#dashboardView.active) .content {
  --dash-card: rgba(8, 19, 32, 0.92);
  --dash-line: rgba(34, 211, 238, 0.2);
  --dash-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
  color: #e8f1fb;
  background:
    linear-gradient(135deg, rgba(18, 199, 192, 0.08), transparent 35%),
    linear-gradient(180deg, #050b12 0%, #07111d 100%);
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .sidebar {
  background: linear-gradient(180deg, #050b12 0%, #07111d 100%);
  border-color: rgba(34, 211, 238, 0.18);
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .sidebar-status {
  background: rgba(8, 24, 26, 0.88);
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .sidebar-brand strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .sidebar-status strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .nav-btn {
  color: #dbeafe;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .nav-section p {
  color: #7f94aa;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .route-shell,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .topbar {
  border-color: rgba(34, 211, 238, 0.18);
  background: rgba(7, 17, 29, 0.96);
}

body[data-theme="dark"] .atlas-hero-copy,
body[data-theme="dark"] .atlas-status-stack,
body[data-theme="dark"] .atlas-visual-card,
body[data-theme="dark"] .atlas-kpi-panel,
body[data-theme="dark"] .atlas-flow-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-chart-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-activity-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .running-task-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .market-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .template-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .risk-panel {
  border-color: rgba(34, 211, 238, 0.2);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.1), transparent 42%),
    rgba(7, 17, 29, 0.94) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

body[data-theme="dark"] .atlas-hero-copy::after {
  border-color: rgba(34, 211, 238, 0.42);
}

body[data-theme="dark"] .atlas-status-stack > div,
body[data-theme="dark"] .command-kpi-grid .metric-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .activity-feed div,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .today-action-item,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .task-card,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .empty-state,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .priority-table-head,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .priority-item,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .funnel-item,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .insight-item,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .alert-item,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .open-event,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .tracking-meter,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .pixel-code-box,
body[data-theme="dark"] .mail-task-progress,
body[data-theme="dark"] .mail-queue-summary,
body[data-theme="dark"] .mail-batch-card,
body[data-theme="dark"] .mail-batch-summary,
body[data-theme="dark"] .mail-queue-item,
body[data-theme="dark"] .seller-profile-panel,
body[data-theme="dark"] .mail-signature-panel,
body[data-theme="dark"] .email-style-toolbar,
body[data-theme="dark"] .writer-template-box,
body[data-theme="dark"] .filterable-select-panel,
body[data-theme="dark"] .search-template-panel,
body[data-theme="dark"] .compact-integration-panel,
body[data-theme="dark"] .help-card-list > div,
body[data-theme="dark"] .announcement-timeline,
body[data-theme="dark"] .draft-modal-panel {
  color: #e8f1fb;
  border-color: rgba(34, 211, 238, 0.18);
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.08), transparent 46%),
    rgba(9, 21, 34, 0.94) !important;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

body[data-theme="dark"] .atlas-status-stack span,
body[data-theme="dark"] .command-status-grid span,
body[data-theme="dark"] .atlas-mini-metrics .metric-panel span,
body[data-theme="dark"] .atlas-mini-metrics .metric-panel small,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .activity-feed small,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .empty-state span,
body[data-theme="dark"] .mail-queue-summary span,
body[data-theme="dark"] .mail-queue-main span,
body[data-theme="dark"] .mail-queue-main small {
  color: #91a6bc !important;
}

body[data-theme="dark"] .atlas-status-stack strong,
body[data-theme="dark"] .command-status-grid strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) h3,
body[data-theme="dark"] .atlas-mini-metrics .metric-panel strong,
body[data-theme="dark"] .mail-queue-summary strong,
body[data-theme="dark"] .mail-queue-main strong {
  color: #f3f8ff !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .trend-chart,
body[data-theme="dark"] .atlas-map {
  border-color: rgba(34, 211, 238, 0.16);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(20, 184, 166, 0.08)),
    #081522 !important;
}

body[data-theme="dark"] .signal-strip span {
  color: #dbeafe;
  border-color: rgba(34, 211, 238, 0.16);
  background: rgba(12, 27, 43, 0.9);
}

body[data-theme="dark"] .table-wrap {
  border-color: rgba(34, 211, 238, 0.18);
  background: #07111d !important;
}

body[data-theme="dark"] .table-wrap table,
body[data-theme="dark"] .table-wrap thead,
body[data-theme="dark"] .table-wrap tbody,
body[data-theme="dark"] .table-wrap tr,
body[data-theme="dark"] .table-wrap td {
  background: #07111d !important;
}

body[data-theme="dark"] .table-wrap th {
  color: #c5d4e4;
  border-color: rgba(148, 163, 184, 0.16);
  background: #0b1826 !important;
}

body[data-theme="dark"] .table-wrap td {
  color: #dce8f5 !important;
  border-color: rgba(148, 163, 184, 0.12);
}

body[data-theme="dark"] .table-wrap tbody tr:nth-child(even) td {
  background: #091827 !important;
}

body[data-theme="dark"] .table-wrap tbody tr:hover td {
  background: rgba(20, 184, 166, 0.1) !important;
}

body[data-theme="dark"] .table-company strong,
body[data-theme="dark"] .contact-name,
body[data-theme="dark"] .lead-column-option-name {
  color: #f3f8ff !important;
}

body[data-theme="dark"] .table-company span,
body[data-theme="dark"] .table-company a,
body[data-theme="dark"] .contact-card small {
  color: #93a9bf !important;
}

body[data-theme="dark"] .th-filter select,
body[data-theme="dark"] .lead-label-select,
body[data-theme="dark"] .lead-star-btn,
body[data-theme="dark"] .lead-note-btn {
  color: #dce8f5;
  border-color: rgba(34, 211, 238, 0.22);
  background-color: #0b1826;
}

body[data-theme="dark"] .draft-modal-panel input,
body[data-theme="dark"] .draft-modal-panel textarea,
body[data-theme="dark"] #mailAutomationView select {
  color: #e8f1fb;
  border-color: rgba(34, 211, 238, 0.18);
  background: #07111d;
}

body[data-theme="dark"] .ghost-btn,
body[data-theme="dark"] .ghost-btn.compact,
body[data-theme="dark"] .mail-batch-actions .ghost-btn,
body[data-theme="dark"] .mail-queue-actions .ghost-btn {
  color: #e8f1fb;
  border-color: rgba(148, 163, 184, 0.24);
  background: #162231;
}

body[data-theme="dark"] .ghost-btn:hover,
body[data-theme="dark"] .ghost-btn.compact:hover {
  border-color: rgba(34, 211, 238, 0.42);
  background: #1c3044;
}

body[data-theme="dark"] {
  --solid-dark-bg: #050c15;
  --solid-dark-panel: #07111d;
  --solid-dark-panel-2: #0a1725;
  --solid-dark-panel-3: #0d1d2d;
  --solid-dark-line: rgba(34, 211, 238, 0.2);
  --solid-dark-line-soft: rgba(148, 163, 184, 0.16);
  --solid-dark-text: #edf6ff;
  --solid-dark-muted: #9aadc2;
  --solid-dark-cyan: #14c8c1;
  background: #050c15 !important;
}

body[data-theme="dark"],
body[data-theme="dark"] .app-frame,
body[data-theme="dark"] .workspace,
body[data-theme="dark"] .main,
body[data-theme="dark"] .content,
body[data-theme="dark"] .view {
  color: var(--solid-dark-text);
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.055), transparent 32%),
    #050c15 !important;
}

body[data-theme="dark"] .app-frame::before {
  opacity: 0.28;
  background:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px) !important;
  background-size: 28px 28px !important;
}

body[data-theme="dark"] .sidebar,
body[data-theme="dark"] .route-shell,
body[data-theme="dark"] .topbar,
body[data-theme="dark"] .panel,
body[data-theme="dark"] .metric-panel,
body[data-theme="dark"] .command-shell,
body[data-theme="dark"] .task-item,
body[data-theme="dark"] .task-item.task-monitor,
body[data-theme="dark"] .mission-item,
body[data-theme="dark"] .mail-queue-item,
body[data-theme="dark"] .mail-batch-card,
body[data-theme="dark"] .mail-batch-summary,
body[data-theme="dark"] .mail-task-progress,
body[data-theme="dark"] .mailbox-switcher,
body[data-theme="dark"] .mailbox-preset-row,
body[data-theme="dark"] .contact-card,
body[data-theme="dark"] .detail-hero-card,
body[data-theme="dark"] .detail-empty-hero,
body[data-theme="dark"] .announcement-item,
body[data-theme="dark"] .announcement-hero,
body[data-theme="dark"] .announcement-side-card,
body[data-theme="dark"] .billing-plan-card,
body[data-theme="dark"] .billing-payment-card,
body[data-theme="dark"] .license-stat,
body[data-theme="dark"] .field-box,
body[data-theme="dark"] .profile-signal-card,
body[data-theme="dark"] .free-source-box,
body[data-theme="dark"] .keyword-engine-shell,
body[data-theme="dark"] .keyword-engine-panel,
body[data-theme="dark"] .keyword-template-card,
body[data-theme="dark"] .keyword-output,
body[data-theme="dark"] .keyword-section,
body[data-theme="dark"] .search-template-panel,
body[data-theme="dark"] .compact-integration-panel,
body[data-theme="dark"] .filterable-select-panel,
body[data-theme="dark"] .category-select-list,
body[data-theme="dark"] .category-option,
body[data-theme="dark"] .email-style-toolbar,
body[data-theme="dark"] .seller-profile-panel,
body[data-theme="dark"] .mail-signature-panel,
body[data-theme="dark"] .draft-modal-panel,
body[data-theme="dark"] .modal-card,
body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .data-table {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.07), transparent 42%),
    var(--solid-dark-panel) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26) !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) {
  background:
    linear-gradient(rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.035) 1px, transparent 1px),
    #050c15 !important;
  background-size: 28px 28px, 28px 28px, auto !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-hero-copy,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-status-stack,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .metric-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-visual-card,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-chart-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-activity-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .running-task-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .market-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .template-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .tracking-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .risk-panel {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.07), transparent 42%),
    var(--solid-dark-panel) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26) !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-status-stack > div,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-kpi-grid .metric-panel,
body[data-theme="dark"] .task-evidence-grid div,
body[data-theme="dark"] .task-stepper span,
body[data-theme="dark"] .activity-feed div,
body[data-theme="dark"] .today-action-item,
body[data-theme="dark"] .priority-table-head,
body[data-theme="dark"] .priority-item,
body[data-theme="dark"] .funnel-item,
body[data-theme="dark"] .insight-item,
body[data-theme="dark"] .alert-item,
body[data-theme="dark"] .open-event,
body[data-theme="dark"] .tracking-meter,
body[data-theme="dark"] .pixel-code-box,
body[data-theme="dark"] .system-line,
body[data-theme="dark"] .signal-strip span,
body[data-theme="dark"] .lead-column-option,
body[data-theme="dark"] .mail-queue-summary {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line-soft) !important;
  background: var(--solid-dark-panel-2) !important;
  box-shadow: none !important;
}

body[data-theme="dark"] .task-progress-ring,
body[data-theme="dark"] .task-monitor.done .task-progress-ring,
body[data-theme="dark"] .task-monitor.failed .task-progress-ring {
  background:
    radial-gradient(circle at center, var(--solid-dark-panel) 0 58%, transparent 59%),
    conic-gradient(#14c8c1 0 var(--value), rgba(148, 163, 184, 0.18) var(--value) 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.16) !important;
}

body[data-theme="dark"] .task-monitor.done .task-progress-ring {
  background:
    radial-gradient(circle at center, var(--solid-dark-panel) 0 58%, transparent 59%),
    conic-gradient(#22c55e 0 var(--value), rgba(148, 163, 184, 0.18) var(--value) 100%) !important;
}

body[data-theme="dark"] .task-monitor.failed .task-progress-ring {
  background:
    radial-gradient(circle at center, var(--solid-dark-panel) 0 58%, transparent 59%),
    conic-gradient(#ef4444 0 var(--value), rgba(148, 163, 184, 0.18) var(--value) 100%) !important;
}

body[data-theme="dark"] textarea,
body[data-theme="dark"] input,
body[data-theme="dark"] select,
body[data-theme="dark"] .filterable-select-trigger,
body[data-theme="dark"] .filterable-select-panel input,
body[data-theme="dark"] .toolbar input,
body[data-theme="dark"] .toolbar-select,
body[data-theme="dark"] .lead-label-select,
body[data-theme="dark"] .email-style-grid select,
body[data-theme="dark"] .email-style-grid input[type="color"],
body[data-theme="dark"] .admin-reset-password-input,
body[data-theme="dark"] .auth-form input {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line-soft) !important;
  background: #050b12 !important;
  box-shadow: none !important;
}

body[data-theme="dark"] textarea::placeholder,
body[data-theme="dark"] input::placeholder,
body[data-theme="dark"] .filterable-select-trigger span:first-child {
  color: #8aa0b7 !important;
}

body[data-theme="dark"] option {
  color: var(--solid-dark-text);
  background: #050b12;
}

body[data-theme="dark"] .table-wrap,
body[data-theme="dark"] .table-wrap table,
body[data-theme="dark"] .table-wrap thead,
body[data-theme="dark"] .table-wrap tbody,
body[data-theme="dark"] .table-wrap tr,
body[data-theme="dark"] .table-wrap th,
body[data-theme="dark"] .table-wrap td {
  background: var(--solid-dark-panel) !important;
}

body[data-theme="dark"] .table-wrap th {
  color: #c5d4e4 !important;
  background: var(--solid-dark-panel-3) !important;
}

body[data-theme="dark"] .table-wrap td {
  color: #dce8f5 !important;
}

body[data-theme="dark"] .table-wrap tbody tr:nth-child(even) td {
  background: #081725 !important;
}

body[data-theme="dark"] .table-wrap tbody tr:hover td {
  background: rgba(20, 184, 166, 0.12) !important;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] strong,
body[data-theme="dark"] .table-company strong,
body[data-theme="dark"] .task-monitor-head strong,
body[data-theme="dark"] .task-evidence-grid strong,
body[data-theme="dark"] .task-progress-ring strong,
body[data-theme="dark"] .metric-panel strong,
body[data-theme="dark"] .filterable-select-option span {
  color: var(--solid-dark-text) !important;
}

body[data-theme="dark"] label,
body[data-theme="dark"] small,
body[data-theme="dark"] .settings-helper,
body[data-theme="dark"] .task-stage-line span,
body[data-theme="dark"] .task-note,
body[data-theme="dark"] .task-evidence-grid small,
body[data-theme="dark"] .task-progress-ring span,
body[data-theme="dark"] .metric-panel span,
body[data-theme="dark"] .metric-panel small,
body[data-theme="dark"] .filterable-select-option small,
body[data-theme="dark"] .table-company span,
body[data-theme="dark"] .table-company a {
  color: var(--solid-dark-muted) !important;
}

body[data-theme="dark"] .task-stepper span.done,
body[data-theme="dark"] .task-stepper span.current {
  color: #35d399 !important;
  border-color: rgba(34, 197, 94, 0.24) !important;
  background: rgba(22, 101, 52, 0.22) !important;
}

body[data-theme="dark"] .task-stepper span.current {
  color: #7dd3fc !important;
  border-color: rgba(59, 130, 246, 0.34) !important;
  background: rgba(30, 64, 175, 0.22) !important;
}

body[data-theme="dark"] .filterable-select-option:hover,
body[data-theme="dark"] .filterable-select-option.is-active,
body[data-theme="dark"] .filterable-select-option.is-selected {
  background: rgba(20, 184, 166, 0.14) !important;
}

body[data-theme="dark"] .atlas-map,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-map {
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(20, 184, 166, 0.08)),
    var(--solid-dark-panel-2) !important;
}

body[data-theme="dark"] .atlas-labels text,
body[data-theme="dark"] .atlas-map-legend text {
  fill: #dbeafe;
  stroke: rgba(5, 12, 21, 0.72);
}

/* Final pass: keep dark mode consistent across secondary pages. */
body[data-theme="dark"] .identity-block,
body[data-theme="dark"] .detail-profile-card,
body[data-theme="dark"] .opportunity-detail-card,
body[data-theme="dark"] .profile-signal,
body[data-theme="dark"] .profile-match-list > div,
body[data-theme="dark"] .opportunity-next-grid > div,
body[data-theme="dark"] .detail-empty-section,
body[data-theme="dark"] .detail-empty-stat,
body[data-theme="dark"] .detail-preview-grid > div,
body[data-theme="dark"] .detail-empty-lead,
body[data-theme="dark"] .detail-empty-fallback,
body[data-theme="dark"] .automation-stat,
body[data-theme="dark"] .opportunity-stage-card,
body[data-theme="dark"] .opportunity-agent-card,
body[data-theme="dark"] .opportunity-action-item,
body[data-theme="dark"] .help-search-card,
body[data-theme="dark"] .help-section,
body[data-theme="dark"] .help-steps li,
body[data-theme="dark"] .help-mini-card,
body[data-theme="dark"] .help-faq-item,
body[data-theme="dark"] .help-card-list > div,
body[data-theme="dark"] .announcement-summary,
body[data-theme="dark"] .announcement-rule-list > div,
body[data-theme="dark"] .device-strip,
body[data-theme="dark"] .auth-device-strip,
body[data-theme="dark"] .license-box,
body[data-theme="dark"] .billing-order-item,
body[data-theme="dark"] .billing-order-preview,
body[data-theme="dark"] .integration-card,
body[data-theme="dark"] .integration-card.required,
body[data-theme="dark"] .integration-card.optional,
body[data-theme="dark"] .integration-footer {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.075), transparent 44%),
    var(--solid-dark-panel-2) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24) !important;
}

body[data-theme="dark"] .help-hero,
body[data-theme="dark"] .announcement-hero,
body[data-theme="dark"] .detail-empty-hero,
body[data-theme="dark"] .opportunity-shell,
body[data-theme="dark"] .opportunity-stage-board,
body[data-theme="dark"] .opportunity-agent-grid,
body[data-theme="dark"] .opportunity-action-list {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.09), transparent 48%),
    #07111d !important;
}

body[data-theme="dark"] .opportunity-funnel-card,
body[data-theme="dark"] .opportunity-work-item,
body[data-theme="dark"] .suppression-item,
body[data-theme="dark"] .opportunity-cycle-summary > div,
body[data-theme="dark"] .opportunity-draft-preview {
  color: var(--solid-dark-text);
  border-color: var(--solid-dark-line-soft) !important;
  background: #081725 !important;
}

body[data-theme="dark"] .profile-highlight-list span,
body[data-theme="dark"] .tag,
body[data-theme="dark"] .announcement-tag,
body[data-theme="dark"] .auth-security-row span,
body[data-theme="dark"] .detail-hero-score,
body[data-theme="dark"] .score-ring,
body[data-theme="dark"] .opportunity-stage-index,
body[data-theme="dark"] .queue-index-pill,
body[data-theme="dark"] .license-pill {
  color: #dffaff !important;
  border-color: rgba(34, 211, 238, 0.22) !important;
  background: rgba(20, 184, 166, 0.12) !important;
}

body[data-theme="dark"] .device-strip code,
body[data-theme="dark"] .auth-device-strip code,
body[data-theme="dark"] .license-code-view textarea {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line-soft) !important;
  background: #050b12 !important;
}

body[data-theme="dark"] .progress-track,
body[data-theme="dark"] .mail-task-progress-track,
body[data-theme="dark"] .opportunity-stage-card .mini-progress {
  background: rgba(148, 163, 184, 0.16) !important;
}

body[data-theme="dark"] .company-summary,
body[data-theme="dark"] .profile-source-note,
body[data-theme="dark"] .opportunity-stage-card p,
body[data-theme="dark"] .opportunity-agent-card p,
body[data-theme="dark"] .opportunity-action-item span,
body[data-theme="dark"] .help-steps span,
body[data-theme="dark"] .help-card-list span,
body[data-theme="dark"] .help-mini-card span,
body[data-theme="dark"] .help-faq-item p,
body[data-theme="dark"] .announcement-summary span,
body[data-theme="dark"] .announcement-summary small,
body[data-theme="dark"] .announcement-rule-list span,
body[data-theme="dark"] .billing-order-item span,
body[data-theme="dark"] .billing-order-item small,
body[data-theme="dark"] .integration-card label,
body[data-theme="dark"] .integration-card-header span,
body[data-theme="dark"] .integration-footer .settings-helper,
body[data-theme="dark"] .device-strip span,
body[data-theme="dark"] .auth-device-strip span {
  color: var(--solid-dark-muted) !important;
}

body[data-theme="dark"] .profile-signal strong,
body[data-theme="dark"] .profile-match-list strong,
body[data-theme="dark"] .opportunity-next-grid strong,
body[data-theme="dark"] .opportunity-stage-card strong,
body[data-theme="dark"] .opportunity-agent-card strong,
body[data-theme="dark"] .opportunity-action-item strong,
body[data-theme="dark"] .help-steps strong,
body[data-theme="dark"] .help-card-list strong,
body[data-theme="dark"] .help-mini-card strong,
body[data-theme="dark"] .announcement-rule-list strong,
body[data-theme="dark"] .billing-order-item strong,
body[data-theme="dark"] .integration-card-header strong,
body[data-theme="dark"] .device-strip code,
body[data-theme="dark"] .auth-device-strip code {
  color: var(--solid-dark-text) !important;
}

/* Residual dark-mode cleanup for dashboard cards, selects and settings data blocks. */
body[data-theme="dark"] {
  color-scheme: dark;
}

body[data-theme="dark"] .filterable-select-panel,
body[data-theme="dark"] .filterable-select-list,
body[data-theme="dark"] .lead-column-menu,
body[data-theme="dark"] .category-select-list {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.075), transparent 44%),
    var(--solid-dark-panel-2) !important;
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.36) !important;
}

body[data-theme="dark"] .filterable-select-option,
body[data-theme="dark"] .lead-column-option,
body[data-theme="dark"] .category-option {
  color: var(--solid-dark-text) !important;
  background: transparent !important;
}

body[data-theme="dark"] .filterable-select-option:hover,
body[data-theme="dark"] .filterable-select-option.is-active,
body[data-theme="dark"] .filterable-select-option.is-selected,
body[data-theme="dark"] .lead-column-option:hover,
body[data-theme="dark"] .category-option:hover,
body[data-theme="dark"] .category-option.is-active {
  background: rgba(20, 184, 166, 0.16) !important;
}

body[data-theme="dark"] select,
body[data-theme="dark"] select option,
body[data-theme="dark"] select optgroup {
  color: var(--solid-dark-text) !important;
  background-color: #050b12 !important;
}

body[data-theme="dark"] .th-filter select {
  -webkit-appearance: none;
  appearance: none;
  border-color: rgba(34, 211, 238, 0.28) !important;
  background-color: #050b12 !important;
  background-image:
    linear-gradient(45deg, transparent 50%, #dffaff 50%),
    linear-gradient(135deg, #dffaff 50%, transparent 50%) !important;
  background-position:
    calc(50% - 4px) 52%,
    calc(50% + 4px) 52% !important;
  background-repeat: no-repeat !important;
  background-size: 6px 6px, 6px 6px !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-date-card,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-status-grid > div,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .source-board,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .donut-card,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .priority-meta,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .priority-item:hover,
body[data-theme="dark"] .settings-note,
body[data-theme="dark"] .data-actions > * {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.075), transparent 44%),
    var(--solid-dark-panel-2) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24) !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-date-card span,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-status-grid span,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .source-board span,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .donut-card span,
body[data-theme="dark"] .settings-note span {
  color: var(--solid-dark-muted) !important;
}

body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-date-card strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .command-status-grid strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .source-board strong,
body[data-theme="dark"] .workspace:has(#dashboardView.active) .donut-card strong,
body[data-theme="dark"] .settings-note strong {
  color: var(--solid-dark-text) !important;
}

/* Dark task-page panel cleanup. */
body[data-theme="dark"] .source-note,
body[data-theme="dark"] .free-source-box,
body[data-theme="dark"] .free-test-import,
body[data-theme="dark"] .local-smart-engine-box,
body[data-theme="dark"] .task-advanced-options,
body[data-theme="dark"] .cost-preview,
body[data-theme="dark"] .logic-step,
body[data-theme="dark"] .search-logic-panel,
body[data-theme="dark"] .logic-grid {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line) !important;
  background:
    linear-gradient(135deg, rgba(20, 184, 166, 0.075), transparent 44%),
    var(--solid-dark-panel-2) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24) !important;
}

body[data-theme="dark"] .source-channel-grid label,
body[data-theme="dark"] .source-validation-row label,
body[data-theme="dark"] .free-source-grid span {
  color: var(--solid-dark-text) !important;
  border-color: rgba(34, 211, 238, 0.2) !important;
  background: rgba(10, 23, 37, 0.94) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025) !important;
}

body[data-theme="dark"] .source-channel-grid label:has(input:checked) {
  color: #dffaff !important;
  border-color: rgba(20, 184, 166, 0.38) !important;
  background: rgba(20, 184, 166, 0.14) !important;
}

body[data-theme="dark"] .source-validation-row label:has(input:checked) {
  color: #fff2cd !important;
  border-color: rgba(233, 190, 106, 0.42) !important;
  background: rgba(233, 190, 106, 0.14) !important;
}

body[data-theme="dark"] .source-note,
body[data-theme="dark"] .free-source-box small,
body[data-theme="dark"] .free-test-import span,
body[data-theme="dark"] .local-smart-engine-box small,
body[data-theme="dark"] .local-smart-engine-box span,
body[data-theme="dark"] .cost-preview span,
body[data-theme="dark"] .logic-step p {
  color: var(--solid-dark-muted) !important;
}

body[data-theme="dark"] .free-source-box strong,
body[data-theme="dark"] .local-smart-engine-box strong,
body[data-theme="dark"] .cost-preview strong,
body[data-theme="dark"] .logic-step strong {
  color: var(--solid-dark-text) !important;
}

body[data-theme="dark"] .logic-step span {
  color: #e8fbff !important;
  background: linear-gradient(135deg, #14c8c1, #3b6df6) !important;
}

body[data-theme="dark"] .task-advanced-options > summary,
body[data-theme="dark"] .keyword-helper-summary {
  color: var(--solid-dark-text) !important;
}

body[data-theme="dark"] .task-advanced-options > summary small {
  color: var(--solid-dark-muted) !important;
}

body[data-theme="dark"] .task-advanced-grid,
body[data-theme="dark"] .simplified-keyword-helper[open] .keyword-engine-grid {
  border-color: var(--solid-dark-line) !important;
}

body[data-theme="dark"] .source-channel-grid input {
  accent-color: var(--solid-dark-cyan);
}
/* Recovery fix: auth/preview content must remain reachable on short and narrow viewports. */
html,
body {
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body:has(#authShell:not([hidden])) {
  overflow-y: auto;
}

.app-frame {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: visible;
}

.auth-shell {
  min-height: 100dvh;
  height: auto;
  max-height: none;
  align-items: stretch;
  overflow: visible;
}

.auth-visual-panel {
  min-height: 100dvh;
  height: auto;
  max-height: none;
}

.auth-card {
  max-height: calc(100dvh - 32px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

@media (min-width: 981px) and (max-height: 790px) {
  .auth-shell {
    min-height: 760px;
  }

  .auth-visual-panel {
    min-height: 760px;
  }

  .auth-card {
    max-height: calc(100dvh - 28px);
    overflow-y: auto;
  }
}

@media (max-width: 980px) {
  body:has(#authShell:not([hidden])) {
    overflow-y: auto;
  }

  .auth-shell {
    min-height: 100dvh;
    height: auto;
    max-height: none;
    grid-template-columns: 1fr;
    padding-bottom: 24px;
    overflow: visible;
  }

  .auth-visual-panel {
    min-height: auto;
    height: auto;
    max-height: none;
    padding-bottom: 24px;
    overflow: visible;
  }

  .auth-card {
    position: relative;
    inset: auto;
    z-index: 6;
    width: min(620px, calc(100% - 32px));
    max-height: none;
    margin: -8px auto 0;
    overflow: visible;
  }

  .auth-card-head span,
  .auth-security-row,
  .auth-device-strip {
    display: flex;
  }
}

@media (max-width: 640px) {
  .auth-visual-panel {
    padding: 20px 16px;
  }

  .auth-showcase {
    display: none;
  }

  .auth-card {
    width: calc(100% - 24px);
    margin-top: 8px;
    padding: 18px 14px 22px;
    border-radius: 22px;
  }

  .auth-card-head h2 {
    font-size: 1.8rem;
  }

  .auth-challenge-panel {
    grid-template-columns: minmax(0, 1fr) 94px;
  }

  .auth-challenge-panel .ghost-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .auth-security-row {
    grid-template-columns: 1fr;
  }
}

/* Workspace scroll contract: the right content column owns vertical scrolling. */
body:has(#workspace:not([hidden])) {
  overflow: hidden !important;
}

body:has(#workspace:not([hidden])) .app-frame {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden !important;
}

#workspace:not([hidden]) {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

#workspace:not([hidden]) .sidebar {
  min-height: 0;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
}

#workspace:not([hidden]) .main {
  min-height: 0;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#workspace:not([hidden]) .view.active,
#workspace:not([hidden]) #dashboardView.active,
#workspace:not([hidden]) .command-shell {
  min-height: max-content;
}

/* Shared page chrome should scroll with each view, not remain pinned in the content viewport. */
#workspace:not([hidden]) .route-shell,
#workspace:not([hidden]) .topbar {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
}

@media (max-width: 980px) {
  #workspace:not([hidden]) {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    display: block;
  }

  #workspace:not([hidden]) .sidebar {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  #workspace:not([hidden]) .main {
    height: calc(100dvh - 120px);
    min-height: 0;
    overflow-y: auto !important;
  }
}

/* Navigation menus must render above the page header/content while still
   scrolling naturally with the workspace.  `relative` preserves document
   flow; the stacking level prevents the following topbar from covering the
   expanded route menu. */
#workspace:not([hidden]) .route-shell {
  position: relative !important;
  z-index: 40 !important;
  overflow: visible !important;
  isolation: isolate;
}

/* Keep the same layering fix when the page is viewed before `#workspace`
   receives its visible state (for example during auth/session restore). */
.route-shell {
  position: relative;
  z-index: 40;
  overflow: visible !important;
  isolation: isolate;
}

.route-shell .route-menu {
  z-index: 60 !important;
}

.route-shell + .topbar,
.route-shell ~ .topbar {
  position: relative;
  z-index: 1;
}

#workspace:not([hidden]) .route-menu {
  position: absolute;
  z-index: 60 !important;
  overflow: visible;
}

#workspace:not([hidden]) .topbar {
  position: static !important;
  z-index: 1 !important;
}

/* Admin console: the sidebar is a real section navigator and the main column
   owns the only vertical scrollbar.  Keep these rules at the end so they win
   over the shared customer workspace styles above. */
body:has(#adminWorkspace:not([hidden])) {
  overflow: hidden !important;
}

#adminWorkspace:not([hidden]) {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

#adminWorkspace:not([hidden]) .sidebar {
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#adminWorkspace:not([hidden]) .main {
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-bottom: 42px;
}

.admin-console-sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-console-sidebar .sidebar-brand strong,
.admin-console-sidebar .sidebar-account strong,
.admin-console-sidebar .sidebar-status strong {
  color: #ecf8fb;
}

.admin-console-sidebar .sidebar-brand span,
.admin-console-sidebar .sidebar-account span,
.admin-console-sidebar .sidebar-account small,
.admin-console-sidebar .sidebar-status small {
  color: rgba(205, 224, 232, .72);
}

.admin-nav-list {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.admin-nav-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.admin-nav-btn:hover,
.admin-nav-btn.active {
  color: var(--text);
  border-color: rgba(72, 216, 223, .28);
  background: linear-gradient(90deg, rgba(72, 216, 223, .17), rgba(72, 216, 223, .05));
}

.admin-console-sidebar .admin-nav-btn { color: rgba(205, 224, 232, .78); }
.admin-console-sidebar .admin-nav-btn:hover,
.admin-console-sidebar .admin-nav-btn.active { color: #f4feff; }

.admin-nav-btn.active {
  box-shadow: inset 3px 0 0 var(--cyan), 0 8px 18px rgba(0, 0, 0, .12);
}

.admin-nav-btn:active { transform: translateY(1px); }
.admin-nav-icon { width: 22px; color: var(--cyan); text-align: center; font-size: 1.1rem; }
.admin-nav-btn em { margin-left: auto; min-width: 20px; padding: 2px 6px; border-radius: 99px; color: var(--text); background: rgba(245, 159, 56, .2); font-size: .72rem; font-style: normal; text-align: center; }

.admin-view { display: none; min-height: max-content; }
.admin-view.active { display: block; animation: admin-view-in .18s ease-out; }
@keyframes admin-view-in { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.admin-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-page-heading h3 { margin: 0; }
.admin-page-heading > .panel-badge { flex: 0 0 auto; }
.admin-global-status { min-height: 20px; margin: 0 0 4px; }
.admin-quick-panel { grid-column: 1 / -1; }
.admin-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.admin-quick-card { display: grid; gap: 6px; padding: 15px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: rgba(255,255,255,.035); text-align: left; cursor: pointer; }
.admin-quick-card:hover { border-color: rgba(72,216,223,.36); background: rgba(72,216,223,.08); }
.admin-quick-card span { color: var(--muted); font-size: .82rem; line-height: 1.4; }
.admin-license-layout { align-items: start; }
.admin-license-layout .admin-license-panel { grid-column: 1 / 6; }
.admin-license-layout .admin-license-list-panel { grid-column: 6 / -1; }
.admin-system-panel { display: grid; gap: 16px; }
.admin-collapse-panel { overflow: visible; }

@media (max-width: 980px) {
  body:has(#adminWorkspace:not([hidden])) { overflow-y: auto !important; }
  #adminWorkspace:not([hidden]) { height: auto; min-height: 100dvh; overflow: visible; }
  #adminWorkspace:not([hidden]) .sidebar { height: auto; max-height: none; overflow: visible; }
  #adminWorkspace:not([hidden]) .main { height: auto; min-height: calc(100dvh - 20px); overflow: visible !important; }
  .admin-nav-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-license-layout .admin-license-panel,
  .admin-license-layout .admin-license-list-panel { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .admin-nav-list, .admin-quick-grid { grid-template-columns: 1fr; }
  .admin-page-heading { align-items: flex-start; }
}

/* Admin visual polish: compact the left header/account block and remove the
   duplicated page heading/status rows that made the content begin too low. */
#adminWorkspace:not([hidden]) {
  grid-template-columns: 248px minmax(0, 1fr);
}

#adminWorkspace:not([hidden]) .admin-console-sidebar {
  margin: 0;
  padding: 14px 12px 12px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  gap: 10px;
  box-shadow: 8px 0 28px rgba(15, 31, 45, .12);
}

#adminWorkspace .sidebar-brand {
  min-height: 54px;
  padding: 0 4px 10px;
  gap: 10px;
}

#adminWorkspace .sidebar-brand .brand-mark.small {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

#adminWorkspace .sidebar-brand strong { font-size: .92rem; }
#adminWorkspace .sidebar-brand span { min-height: 18px; margin-top: 2px; padding: 0 7px; font-size: .62rem; }

#adminWorkspace .admin-account-compact {
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 9px;
  border-color: rgba(72, 216, 223, .14);
  background: rgba(255, 255, 255, .055);
}

.admin-account-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(145deg, #0aa6b5, #356dff 58%, #7457d9);
  font-size: .88rem;
  font-weight: 900;
}

.admin-account-copy { min-width: 0; }
.admin-account-copy span,
.admin-account-copy strong,
.admin-account-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-account-copy span { font-size: .68rem; }
.admin-account-copy strong { margin-top: 1px; font-size: .84rem; }
.admin-account-copy small { margin-top: 1px; font-size: .65rem; }

#adminWorkspace .admin-account-compact .ghost-btn {
  width: auto;
  min-height: 30px;
  margin: 0;
  padding: 5px 9px;
  border-color: rgba(255, 255, 255, .16);
  color: #eaf8fb;
  background: rgba(255, 255, 255, .07);
  font-size: .72rem;
}

#adminWorkspace .admin-nav-list {
  gap: 4px;
  margin-top: 2px;
}

#adminWorkspace .admin-nav-btn {
  min-height: 40px;
  padding: 8px 10px;
}

#adminWorkspace .sidebar-status {
  padding: 10px;
  border-radius: 9px;
}

#adminWorkspace:not([hidden]) .main {
  padding: 14px 20px 36px;
}

#adminWorkspace .admin-topbar {
  position: relative !important;
  top: auto !important;
  min-height: 82px;
  margin: 0 0 14px;
  padding: 13px 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 28px rgba(30, 56, 84, .07);
}

#adminWorkspace .admin-topbar .eyebrow { margin: 0 0 2px; }
#adminWorkspace .admin-topbar h2 { margin: 0; font-size: clamp(1.45rem, 2vw, 1.9rem); line-height: 1.15; }
.admin-page-description { margin: 4px 0 0; color: #718293; font-size: .78rem; line-height: 1.4; }

#adminWorkspace:not([hidden]) .main > .admin-global-status {
  position: fixed;
  z-index: 120;
  top: 14px;
  left: 50%;
  min-height: 0;
  max-width: min(520px, calc(100vw - 40px));
  margin: 0;
  padding: 8px 13px;
  border: 1px solid rgba(15, 139, 95, .18);
  border-radius: 999px;
  color: #0f8b5f;
  background: rgba(242, 255, 249, .96);
  box-shadow: 0 10px 28px rgba(18, 72, 56, .12);
  transform: translateX(-50%);
  font-size: .76rem;
  pointer-events: none;
}

#adminWorkspace:not([hidden]) .main > .admin-global-status:empty {
  display: none;
}

#adminWorkspace .admin-view > .admin-page-heading {
  display: none;
}

#adminWorkspace .admin-view > .panel,
#adminWorkspace .admin-view > .admin-layout {
  width: 100%;
}

#adminWorkspace .admin-users-panel,
#adminWorkspace .admin-order-panel,
#adminWorkspace .admin-reset-panel,
#adminWorkspace .admin-audit-panel,
#adminWorkspace .admin-system-panel {
  grid-column: 1 / -1;
}

#adminWorkspace .admin-users-panel { padding: 0; overflow: hidden; }
#adminWorkspace .admin-table-wrap { border: 0; border-radius: 10px; }
#adminWorkspace .admin-table th { position: sticky; top: 0; z-index: 2; background: #f5f8fb; }
#adminWorkspace .admin-table th,
#adminWorkspace .admin-table td { padding: 13px 14px; }

@media (max-width: 980px) {
  #adminWorkspace:not([hidden]) { grid-template-columns: 1fr; }
  #adminWorkspace:not([hidden]) .admin-console-sidebar { border-width: 0; box-shadow: 0 8px 24px rgba(15, 31, 45, .12); }
  #adminWorkspace:not([hidden]) .main { padding: 12px 14px 28px; }
  #adminWorkspace .admin-topbar { align-items: flex-start; }
}

@media (max-width: 560px) {
  #adminWorkspace .admin-account-compact { grid-template-columns: 36px minmax(0, 1fr); }
  #adminWorkspace .admin-account-compact .ghost-btn { grid-column: 1 / -1; width: 100%; }
  #adminWorkspace .admin-topbar { display: grid; }
  #adminWorkspace .topbar-tools { justify-content: flex-start; }
}

/* Search quality audit center */
.quality-audit-layout {
  display: grid;
  min-width: 0;
  gap: 16px;
  padding-bottom: 32px;
}

.quality-audit-layout > .panel,
.quality-audit-overview {
  min-width: 0;
}

.quality-audit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.quality-audit-summary > div,
.quality-audit-coverage > div {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 13px 14px;
  border: 1px solid rgba(40, 103, 255, .12);
  border-radius: 12px;
  background: rgba(244, 248, 255, .78);
}

.quality-audit-summary span,
.quality-audit-coverage span,
.quality-audit-metric-card span {
  color: var(--muted);
  font-size: .78rem;
}

.quality-audit-summary strong,
.quality-audit-coverage strong {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: .98rem;
}

#qualityAuditStatus[data-status="queued"],
#qualityAuditStatus[data-status="running"] { color: #2456d6; }
#qualityAuditStatus[data-status="completed"] { color: #08784c; }
#qualityAuditStatus[data-status="failed"] { color: #c64040; }

.quality-audit-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: .84rem;
}

.quality-audit-progress-head strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.quality-audit-progress-track {
  height: 11px;
  margin-bottom: 11px;
}

#qualityAuditMessage[data-type="error"] {
  color: #c64040;
}

.quality-audit-metric-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.quality-audit-metric-card {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(40, 103, 255, .13);
  border-radius: 12px;
  background: rgba(246, 249, 255, .82);
}

.quality-audit-metric-card > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.quality-audit-metric-card em {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: .7rem;
  font-style: normal;
  font-weight: 800;
}

.quality-audit-metric-card strong {
  color: var(--text);
  font-size: 1.55rem;
  font-variant-numeric: tabular-nums;
}

.quality-audit-metric-card small {
  color: var(--muted);
  line-height: 1.45;
}

.quality-audit-metric-card.passed {
  border-color: rgba(32, 185, 129, .25);
  background: rgba(235, 251, 244, .75);
}

.quality-audit-metric-card.passed em,
.quality-audit-result.passed {
  color: #08784c;
  background: rgba(32, 185, 129, .12);
}

.quality-audit-metric-card.failed {
  border-color: rgba(219, 73, 73, .22);
  background: rgba(255, 242, 242, .72);
}

.quality-audit-metric-card.failed em,
.quality-audit-result.failed {
  color: #b83232;
  background: rgba(219, 73, 73, .11);
}

#qualityAuditMetricBadge[data-status="passed"] {
  color: #08784c;
  border-color: rgba(32, 185, 129, .2);
  background: rgba(232, 250, 242, .96);
}

#qualityAuditMetricBadge[data-status="warning"] {
  color: #9b6100;
  border-color: rgba(231, 151, 34, .22);
  background: rgba(255, 246, 224, .92);
}

.quality-audit-coverage {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
}

.quality-audit-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(25, 39, 52, .09);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
}

.quality-audit-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  color: var(--text);
  font-size: .82rem;
}

.quality-audit-table th,
.quality-audit-table td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(25, 39, 52, .08);
  text-align: left;
  vertical-align: top;
}

.quality-audit-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
}

.quality-audit-table tbody tr:last-child td { border-bottom: 0; }
.quality-audit-table td small { display: block; max-width: 260px; margin-top: 4px; color: #b83232; line-height: 1.4; }
.quality-audit-table td small.quality-audit-scenario-meta { color: var(--muted); font-size: .76rem; }

@media (max-width: 720px) {
  .source-validation-row { grid-template-columns: 1fr; }
}

.quality-audit-result {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .73rem;
  font-weight: 800;
  white-space: nowrap;
}

.quality-audit-failures {
  display: grid;
  gap: 10px;
}

.quality-audit-failures article {
  padding: 13px 14px;
  border: 1px solid rgba(219, 73, 73, .18);
  border-left: 4px solid rgba(219, 73, 73, .72);
  border-radius: 10px;
  background: rgba(255, 245, 245, .72);
}

.quality-audit-failures article > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.quality-audit-failures article span {
  padding: 2px 7px;
  border-radius: 999px;
  color: #9d3030;
  background: rgba(219, 73, 73, .1);
  font-size: .72rem;
  font-weight: 800;
}

.quality-audit-failures article strong { color: var(--text); }
.quality-audit-failures article p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }

@media (max-width: 1180px) {
  .quality-audit-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quality-audit-metric-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
  .quality-audit-coverage { grid-template-columns: repeat(3, minmax(130px, 1fr)); }
}

@media (max-width: 720px) {
  .quality-audit-overview .panel-header { display: grid; }
  .quality-audit-overview .panel-header-actions { justify-content: flex-start; }
  .quality-audit-metric-grid,
  .quality-audit-coverage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .quality-audit-summary,
  .quality-audit-metric-grid,
  .quality-audit-coverage { grid-template-columns: 1fr; }
  .quality-audit-overview .panel-header-actions > button { flex: 1 1 120px; }
}

/* ========================================================================== 
   DealFinds AI interface system — independent visual identity
   ========================================================================== */
:root {
  --bg: #f4f6fb;
  --bg-2: #eef1f7;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-soft: #f7f8fc;
  --line: rgba(41, 48, 78, 0.11);
  --line-strong: rgba(103, 84, 232, 0.28);
  --text: #171b2e;
  --muted: #70778d;
  --dim: #9aa0b2;
  --cyan: #6654e8;
  --green: #24b999;
  --amber: #e9a94f;
  --rose: #e65e79;
  --ink: #111426;
  --shadow: 0 18px 55px rgba(35, 32, 84, 0.10);
  --radius: 14px;
}

body.dealfinds-theme {
  color: var(--text);
  background:
    radial-gradient(circle at 86% 7%, rgba(103, 84, 232, .08), transparent 25%),
    linear-gradient(180deg, #f8f9fc, #f1f3f8);
}

body.dealfinds-theme .app-frame::before {
  background:
    radial-gradient(circle at 86% 8%, rgba(103, 84, 232, .08), transparent 26%),
    radial-gradient(circle at 14% 92%, rgba(49, 210, 176, .07), transparent 28%);
}

/* Authentication */
body.dealfinds-theme .boot-screen,
body.dealfinds-theme .auth-shell {
  background:
    radial-gradient(circle at 18% 18%, rgba(124, 103, 255, .22), transparent 30%),
    radial-gradient(circle at 74% 78%, rgba(49, 210, 176, .14), transparent 28%),
    #101427;
}
body.dealfinds-theme .boot-card {
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 22px;
  color: #f8f9ff;
  background: rgba(24, 29, 55, .9);
  box-shadow: 0 30px 90px rgba(3, 5, 20, .38);
}
body.dealfinds-theme .auth-visual-panel {
  border-right-color: rgba(255,255,255,.08);
  color: #f8f9ff;
  background:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px),
    radial-gradient(circle at 20% 16%, rgba(124,103,255,.24), transparent 28%),
    linear-gradient(145deg, #101427, #171a37 58%, #201b4b);
  background-size: 36px 36px, 36px 36px, auto, auto;
}
body.dealfinds-theme .auth-brand-lockup h1 { color: #fff; letter-spacing: -.035em; }
body.dealfinds-theme .auth-brand-lockup > div > span,
body.dealfinds-theme .auth-card-head > span { color: #9fa8c3; }
body.dealfinds-theme .auth-showcase {
  border-color: rgba(255,255,255,.1);
  border-radius: 22px;
  background: rgba(255,255,255,.055);
  box-shadow: 0 24px 70px rgba(0,0,0,.2);
}
body.dealfinds-theme .auth-showcase-topbar,
body.dealfinds-theme .auth-showcase-footer { border-color: rgba(255,255,255,.08); }
body.dealfinds-theme .auth-proof-grid > div {
  border-color: rgba(255,255,255,.1);
  border-radius: 15px;
  background: rgba(255,255,255,.055);
}
body.dealfinds-theme .auth-card {
  border: 1px solid #e6e8f0;
  border-radius: 24px;
  color: var(--text);
  background: rgba(255,255,255,.98);
  box-shadow: 0 30px 90px rgba(11, 14, 35, .22);
}
body.dealfinds-theme .auth-card-badge { color: #4b3fc2; background: #f0edff; }
body.dealfinds-theme .auth-tabs { padding: 4px; border-radius: 12px; background: #f0f1f6; }
body.dealfinds-theme .auth-tabs button { border-radius: 9px; color: #777d91; }
body.dealfinds-theme .auth-tabs button.active { color: #30286f; background: #fff; box-shadow: 0 5px 14px rgba(35,32,84,.1); }
body.dealfinds-theme input,
body.dealfinds-theme textarea,
body.dealfinds-theme select {
  border-color: #dfe2eb;
  border-radius: 10px;
  color: #20243a;
  background: #fff;
}
body.dealfinds-theme input:focus,
body.dealfinds-theme textarea:focus,
body.dealfinds-theme select:focus {
  border-color: #7665ec;
  outline: 3px solid rgba(103,84,232,.12);
}

/* Workspace shell */
body.dealfinds-theme #workspace:not([hidden]),
body.dealfinds-theme #adminWorkspace:not([hidden]) {
  background: #f4f6fb;
}
body.dealfinds-theme .workspace,
body.dealfinds-theme .workspace:has(#dashboardView.active) {
  grid-template-columns: 232px minmax(0, 1fr);
}
body.dealfinds-theme .workspace .sidebar,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .sidebar,
body.dealfinds-theme #adminWorkspace:not([hidden]) .admin-console-sidebar {
  padding: 16px 12px;
  border-right: 0;
  color: #f4f6ff;
  background:
    radial-gradient(circle at 40% 0%, rgba(117,94,245,.23), transparent 24%),
    linear-gradient(180deg, #111529 0%, #151932 58%, #101326 100%) !important;
  box-shadow: 14px 0 36px rgba(18, 20, 46, .11);
}
body.dealfinds-theme .sidebar-brand {
  min-height: 58px !important;
  margin: 0 2px 4px;
  padding: 8px 7px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
body.dealfinds-theme .sidebar-brand strong,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-brand strong,
body.dealfinds-theme #adminWorkspace .sidebar-brand strong { color: #fff; }
body.dealfinds-theme .sidebar-brand > div > span,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-brand > div > span { color: #85eed8; }
body.dealfinds-theme .logo-mark { border-radius: 13px; box-shadow: 0 10px 26px rgba(95,76,224,.26); }
body.dealfinds-theme .grouped-nav { gap: 12px; }
body.dealfinds-theme .nav-section p { color: #737e9f !important; letter-spacing: .07em; }
body.dealfinds-theme .workspace .nav-btn,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #adb5cf;
  font-size: .84rem;
  font-weight: 760;
  background: transparent;
}
body.dealfinds-theme .workspace .nav-btn span,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn span,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn span { color: #7f8aac; background: transparent; }
body.dealfinds-theme .workspace .nav-btn:hover,
body.dealfinds-theme .workspace .nav-btn.active,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn:hover,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn.active,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn:hover,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn.active {
  border-color: rgba(137,119,255,.15);
  color: #fff;
  background: linear-gradient(90deg, rgba(112,91,239,.28), rgba(112,91,239,.1));
}
body.dealfinds-theme .workspace .nav-btn.active span,
body.dealfinds-theme .workspace .nav-btn:hover span { color: #8ef1dc; }
body.dealfinds-theme .nav-module-toggle { color: #7f8aac; }
body.dealfinds-theme .nav-module-toggle:hover { color:#fff; background:rgba(112,91,239,.18); }
body.dealfinds-theme .nav-submenu { border-left-color: rgba(126,106,243,.32); }
body.dealfinds-theme .nav-submenu .nav-btn.nav-sub-btn { color:#919bb9; }
body.dealfinds-theme .sidebar-account,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-account,
body.dealfinds-theme .sidebar-status,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-status,
body.dealfinds-theme #adminWorkspace .sidebar-status {
  border-color: rgba(255,255,255,.08) !important;
  border-radius: 12px;
  color: #e9ecfa;
  background: rgba(255,255,255,.055) !important;
}
body.dealfinds-theme .sidebar-account strong,
body.dealfinds-theme .sidebar-status strong,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-account strong,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-status strong { color:#fff; }
body.dealfinds-theme .sidebar-account span,
body.dealfinds-theme .sidebar-account small,
body.dealfinds-theme .sidebar-status small { color:#8993b1; }

body.dealfinds-theme .main,
body.dealfinds-theme .workspace:has(#dashboardView.active) .main,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .main {
  color: var(--text);
  background:
    radial-gradient(circle at 92% 0%, rgba(103,84,232,.065), transparent 24%),
    #f4f6fb;
}
body.dealfinds-theme .route-shell {
  border: 1px solid rgba(41,48,78,.09);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: 0 8px 26px rgba(35,32,84,.06);
  backdrop-filter: blur(16px);
}
body.dealfinds-theme .route-brand { color:#312977; }
body.dealfinds-theme .route-group-btn { border-radius:9px; color:#596078; }
body.dealfinds-theme .route-group.active .route-group-btn,
body.dealfinds-theme .route-group-btn:hover { color:#4d3ecb; background:#f0edff; }
body.dealfinds-theme .route-menu {
  border:1px solid #e4e6ef;
  border-radius:12px;
  background:#fff;
  box-shadow:0 18px 45px rgba(35,32,84,.14);
}
body.dealfinds-theme .route-menu button { color:#596078; }
body.dealfinds-theme .route-menu button:hover,
body.dealfinds-theme .route-menu button.active { color:#4c3dc4; background:#f1efff; }
body.dealfinds-theme .route-tab { border-radius:8px; color:#73798f; background:#f1f2f7; }
body.dealfinds-theme .route-tab.active { color:#fff; background:linear-gradient(135deg,#5e4cda,#7868ef); }
body.dealfinds-theme .topbar {
  border:1px solid rgba(41,48,78,.08);
  border-radius:16px;
  background:rgba(255,255,255,.86);
  box-shadow:0 9px 28px rgba(35,32,84,.055);
}
body.dealfinds-theme .topbar h2 { color:#171b2e; letter-spacing:-.025em; }

/* Cards, controls and data surfaces */
body.dealfinds-theme .panel,
body.dealfinds-theme .identity-block,
body.dealfinds-theme .detail-profile-card,
body.dealfinds-theme .opportunity-detail-card,
body.dealfinds-theme .integration-card,
body.dealfinds-theme .help-section,
body.dealfinds-theme .help-search-card,
body.dealfinds-theme .announcement-item,
body.dealfinds-theme .admin-metric-card,
body.dealfinds-theme .admin-hero-panel {
  border-color: rgba(41,48,78,.1) !important;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255,255,255,.96) !important;
  box-shadow: 0 10px 30px rgba(35,32,84,.055);
}
body.dealfinds-theme .panel:hover { border-color:rgba(103,84,232,.18) !important; }
body.dealfinds-theme .panel-header h3,
body.dealfinds-theme .identity-block h3,
body.dealfinds-theme .field-box strong { color:#171b2e; }
body.dealfinds-theme .eyebrow { color:#6554d9; letter-spacing:.09em; }
body.dealfinds-theme .panel-badge { color:#5c4bd2; background:#f0edff; border-color:#ded8ff; }
body.dealfinds-theme .panel-badge.live { color:#16826d; background:#e6faf5; border-color:#c7f0e7; }
body.dealfinds-theme .primary-btn,
body.dealfinds-theme .primary-action {
  border-color:transparent;
  color:#fff;
  background:linear-gradient(135deg,#5d4bd5,#806ef4);
  box-shadow:0 10px 22px rgba(94,75,213,.2);
}
body.dealfinds-theme .primary-btn:hover { filter:brightness(1.04); transform:translateY(-1px); }
body.dealfinds-theme .secondary-btn { border-color:#dcd7ff; color:#4f40c6; background:#f3f0ff; }
body.dealfinds-theme .ghost-btn { border-color:#dde0e9; color:#545b72; background:#fff; }
body.dealfinds-theme .ghost-btn:hover { border-color:#cfc8ff; color:#4d3ec5; background:#f5f3ff; }
body.dealfinds-theme .status-pill,
body.dealfinds-theme .tag { border-color:#ded9ff; color:#5546c6; background:#f2efff; }
body.dealfinds-theme table { color:#30364d; }
body.dealfinds-theme th { color:#757c91; background:#f6f7fb; }
body.dealfinds-theme tbody tr:hover { background:#f8f7ff; }
body.dealfinds-theme .metric-panel,
body.dealfinds-theme .automation-stat,
body.dealfinds-theme .opportunity-stage-card,
body.dealfinds-theme .opportunity-agent-card,
body.dealfinds-theme .opportunity-action-item,
body.dealfinds-theme .profile-signal,
body.dealfinds-theme .opportunity-next-grid > div {
  border-color:rgba(41,48,78,.09) !important;
  border-radius:13px;
  color:#20253a;
  background:#f8f9fc !important;
}
body.dealfinds-theme .score-ring {
  background:
    radial-gradient(circle at center, #fff 58%, transparent 59%),
    conic-gradient(#6554df var(--score-angle), #e8e9f0 0);
}
body.dealfinds-theme .score-ring strong { color:#171b2e; }
body.dealfinds-theme .status-actions .ghost-btn { border-radius:10px; }
body.dealfinds-theme .opportunity-collapsible-summary:hover { background:#faf9ff; }
body.dealfinds-theme .opportunity-collapse-state { border-color:#e3dfff; color:#5e50c9; background:#f3f1ff; }
body.dealfinds-theme .opportunity-timeline-item { border-left-color:#6a59df; background:#f7f7fc; }
body.dealfinds-theme .opportunity-timeline-item.type-reply,
body.dealfinds-theme .opportunity-timeline-item.type-wake { border-left-color:#27b99a; }

/* Dashboard identity */
body.dealfinds-theme .command-welcome {
  border:0;
  border-radius:20px;
  color:#fff;
  background:
    radial-gradient(circle at 88% 20%, rgba(137,116,255,.55), transparent 30%),
    radial-gradient(circle at 18% 100%, rgba(49,210,176,.24), transparent 33%),
    linear-gradient(145deg,#15192f,#252050 62%,#332674) !important;
  box-shadow:0 20px 55px rgba(39,31,100,.22);
  overflow:hidden;
}
body.dealfinds-theme .command-welcome h1,
body.dealfinds-theme .command-welcome strong { color:#fff; }
body.dealfinds-theme .command-welcome span { color:#cbd1e8; }
body.dealfinds-theme .command-welcome::after { background:linear-gradient(135deg,transparent,rgba(255,255,255,.08)); }
body.dealfinds-theme .command-date-card,
body.dealfinds-theme .command-status-grid > div { border-color:rgba(255,255,255,.11); background:rgba(255,255,255,.075); }
body.dealfinds-theme .command-date-card span,
body.dealfinds-theme .command-status-grid span { color:#aeb7d3; }
body.dealfinds-theme .command-date-card strong,
body.dealfinds-theme .command-status-grid strong { color:#fff; }
body.dealfinds-theme .metric-icon { color:#5b4bd0; background:#f0edff; }

/* Admin */
body.dealfinds-theme .admin-nav-btn { border-radius:10px; color:#aeb6cf; }
body.dealfinds-theme .admin-nav-btn:hover,
body.dealfinds-theme .admin-nav-btn.active { color:#fff; background:linear-gradient(90deg,rgba(112,91,239,.3),rgba(112,91,239,.1)); }
body.dealfinds-theme .admin-topbar { border-color:rgba(41,48,78,.09); background:#fff; }
body.dealfinds-theme .admin-page-description { color:#777e93; }

/* Dark mode keeps the same brand, with a true midnight workspace. */
body.dealfinds-theme[data-theme="dark"] {
  --bg:#0d1020;
  --bg-2:#11152a;
  --panel:#181c32;
  --panel-strong:#1d213a;
  --panel-soft:#20243e;
  --line:rgba(210,216,245,.1);
  --text:#f2f4ff;
  --muted:#9ca5c2;
  color:var(--text);
  background:#0d1020;
}
body.dealfinds-theme[data-theme="dark"] .main,
body.dealfinds-theme[data-theme="dark"] .workspace:has(#dashboardView.active) .main,
body.dealfinds-theme[data-theme="dark"] .workspace:not(:has(#dashboardView.active)) .main { background:#0d1020; }
body.dealfinds-theme[data-theme="dark"] .route-shell,
body.dealfinds-theme[data-theme="dark"] .topbar,
body.dealfinds-theme[data-theme="dark"] .panel,
body.dealfinds-theme[data-theme="dark"] .identity-block,
body.dealfinds-theme[data-theme="dark"] .detail-profile-card,
body.dealfinds-theme[data-theme="dark"] .opportunity-detail-card {
  color:#eef1ff;
  border-color:rgba(214,220,248,.1) !important;
  background:#171b31 !important;
  box-shadow:0 14px 40px rgba(0,0,0,.18);
}
body.dealfinds-theme[data-theme="dark"] .topbar h2,
body.dealfinds-theme[data-theme="dark"] .panel-header h3,
body.dealfinds-theme[data-theme="dark"] .identity-block h3,
body.dealfinds-theme[data-theme="dark"] .field-box strong { color:#f5f6ff; }
body.dealfinds-theme[data-theme="dark"] input,
body.dealfinds-theme[data-theme="dark"] textarea,
body.dealfinds-theme[data-theme="dark"] select { border-color:#353a55; color:#f0f2ff; background:#111529; }
body.dealfinds-theme[data-theme="dark"] .metric-panel,
body.dealfinds-theme[data-theme="dark"] .automation-stat,
body.dealfinds-theme[data-theme="dark"] .opportunity-stage-card,
body.dealfinds-theme[data-theme="dark"] .opportunity-agent-card,
body.dealfinds-theme[data-theme="dark"] .opportunity-action-item,
body.dealfinds-theme[data-theme="dark"] .profile-signal,
body.dealfinds-theme[data-theme="dark"] .opportunity-next-grid > div { color:#e8ebfb; background:#1d2139 !important; }
body.dealfinds-theme[data-theme="dark"] .score-ring { background:radial-gradient(circle at center,#171b31 58%,transparent 59%),conic-gradient(#8a78ff var(--score-angle),#30354e 0); }
body.dealfinds-theme[data-theme="dark"] .score-ring strong { color:#fff; }

@media (max-width: 1023px) {
  body.dealfinds-theme .workspace,
  body.dealfinds-theme .workspace:has(#dashboardView.active) { grid-template-columns:1fr; }
  body.dealfinds-theme .workspace .sidebar,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar,
  body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .sidebar { border-radius:0 0 18px 18px; }
}

/* DealFinds dashboard hero */
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
  min-height: 136px;
  border: 0;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 18%, rgba(137,116,255,.58), transparent 30%),
    radial-gradient(circle at 12% 110%, rgba(49,210,176,.28), transparent 32%),
    linear-gradient(140deg,#15192f,#252050 62%,#352779) !important;
  box-shadow: 0 18px 46px rgba(39,31,100,.2);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy::after {
  border-top-color: rgba(142,241,220,.7);
  border-right-color: rgba(255,202,114,.55);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy .eyebrow { color:#8ef1dc; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 { color:#fff; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy > span { color:#c4cae0; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn {
  color:#20175b;
  background:linear-gradient(135deg,#8ef1dc,#5fd6cc);
  box-shadow:0 10px 24px rgba(49,210,176,.2);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link { color:#fff; background:rgba(255,255,255,.09); border-color:rgba(255,255,255,.14); }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
  border-color:rgba(41,48,78,.09);
  border-radius:18px;
  background:#fff;
  box-shadow:0 12px 34px rgba(35,32,84,.07);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack > div { background:linear-gradient(135deg,#fff,#f7f6ff); }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-flow-panel,
body.dealfinds-theme .workspace:has(#dashboardView.active) .panel { border-radius:16px; }

@media (min-width: 1180px) and (max-height: 820px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 72px;
    height: 72px;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
    padding: 8px 16px;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    margin: 2px 0 0;
    font-size: clamp(1.35rem, 1.9vw, 1.75rem);
    line-height: 1.05;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy .eyebrow { font-size: .62rem; }
}

/* ========================================================================== 
   DealFinds Executive Edition — premium product finish
   ========================================================================== */
body.dealfinds-theme {
  --df-lux-ink: #11121a;
  --df-lux-graphite: #171925;
  --df-lux-violet: #7767e8;
  --df-lux-mint: #50cbb2;
  --df-lux-gold: #c9aa70;
  --df-lux-canvas: #f3f2ef;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 1;
  background: var(--df-lux-canvas);
}
body.dealfinds-theme .main,
body.dealfinds-theme .workspace:has(#dashboardView.active) .main,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .main {
  background:
    radial-gradient(circle at 92% 0%, rgba(119,103,232,.055), transparent 22%),
    linear-gradient(180deg,#f7f6f3,#f1f1ef 68%,#f4f4f2);
}
body.dealfinds-theme .workspace .sidebar,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .sidebar,
body.dealfinds-theme #adminWorkspace:not([hidden]) .admin-console-sidebar {
  background:
    radial-gradient(circle at 50% -6%, rgba(132,112,248,.18), transparent 24%),
    linear-gradient(180deg,#10111b 0%,#151725 50%,#0f101a 100%) !important;
  box-shadow: 18px 0 50px rgba(12,13,24,.12);
}
body.dealfinds-theme .sidebar-brand { border-bottom-color:rgba(255,255,255,.065); }
body.dealfinds-theme .logo-mark { box-shadow:0 8px 24px rgba(85,67,196,.2); }
body.dealfinds-theme .workspace .nav-btn,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn {
  position:relative;
  color:#9097ad;
  letter-spacing:.005em;
}
body.dealfinds-theme .workspace .nav-btn:hover,
body.dealfinds-theme .workspace .nav-btn.active,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn:hover,
body.dealfinds-theme .workspace:has(#dashboardView.active) .nav-btn.active,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn:hover,
body.dealfinds-theme .workspace:not(:has(#dashboardView.active)) .nav-btn.active {
  border-color:rgba(161,145,255,.1);
  color:#fff;
  background:rgba(255,255,255,.065);
  box-shadow:inset 2px 0 0 #8877f2;
}
body.dealfinds-theme .workspace .nav-btn.active span,
body.dealfinds-theme .workspace .nav-btn:hover span { color:#9c8eff; }
body.dealfinds-theme .sidebar-account,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-account,
body.dealfinds-theme .sidebar-status,
body.dealfinds-theme .workspace:has(#dashboardView.active) .sidebar-status {
  background:rgba(255,255,255,.035) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}

body.dealfinds-theme .route-shell {
  border-color:rgba(32,34,50,.075);
  border-radius:16px;
  background:rgba(252,252,250,.88);
  box-shadow:0 1px 0 rgba(255,255,255,.9),0 12px 34px rgba(26,27,42,.055);
}
body.dealfinds-theme .route-brand { color:#171925; font-weight:900; letter-spacing:-.02em; }
body.dealfinds-theme .route-group.active .route-group-btn,
body.dealfinds-theme .route-group-btn:hover { color:#5d50bc; background:#eeebff; }
body.dealfinds-theme .route-tab { color:#777b89; background:#eeedea; }
body.dealfinds-theme .route-tab.active { color:#fff; background:#171925; box-shadow:0 7px 18px rgba(23,25,37,.16); }
body.dealfinds-theme .topbar {
  border-color:rgba(32,34,50,.075);
  border-radius:17px;
  background:rgba(252,252,250,.92);
  box-shadow:0 1px 0 rgba(255,255,255,.95),0 13px 36px rgba(26,27,42,.055);
}
body.dealfinds-theme .topbar::after { display:none !important; }
body.dealfinds-theme .topbar h2 { font-weight:900; letter-spacing:-.035em; }

body.dealfinds-theme .panel,
body.dealfinds-theme .identity-block,
body.dealfinds-theme .detail-profile-card,
body.dealfinds-theme .opportunity-detail-card,
body.dealfinds-theme .integration-card,
body.dealfinds-theme .help-section,
body.dealfinds-theme .help-search-card,
body.dealfinds-theme .announcement-item,
body.dealfinds-theme .admin-metric-card,
body.dealfinds-theme .admin-hero-panel {
  border-color:rgba(32,34,50,.085) !important;
  border-radius:18px;
  background:#fdfdfc !important;
  box-shadow:0 1px 1px rgba(20,21,33,.025),0 14px 40px rgba(25,26,43,.055);
}
body.dealfinds-theme .panel:hover { border-color:rgba(119,103,232,.19) !important; }
body.dealfinds-theme .eyebrow { color:#6e60d3; font-size:.68rem; letter-spacing:.11em; }
body.dealfinds-theme .panel-header h3 { font-weight:880; letter-spacing:-.025em; }
body.dealfinds-theme .panel-badge { border-color:#ddd8fa; color:#5e51bd; background:#f0edff; }
body.dealfinds-theme .panel-badge.live { border-color:#cce9e2; color:#227c68; background:#ecf8f5; }
body.dealfinds-theme .primary-btn,
body.dealfinds-theme .primary-action {
  color:#fff;
  background:linear-gradient(145deg,#242637,#151722);
  box-shadow:0 10px 24px rgba(18,19,30,.16),inset 0 1px 0 rgba(255,255,255,.12);
}
body.dealfinds-theme .secondary-btn { border-color:#dedbe9; color:#373948; background:#f7f6f3; }
body.dealfinds-theme .ghost-btn { border-color:#dfded9; color:#555867; background:#fcfcfb; }
body.dealfinds-theme .ghost-btn:hover { border-color:#cbc5ee; color:#5c50b6; background:#f3f0ff; }
body.dealfinds-theme .tag,
body.dealfinds-theme .status-pill { border-color:#e0ddee; color:#5f54a8; background:#f5f3fb; }

/* Executive overview: one dark signal card, neutral KPI rail. */
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
  background:
    radial-gradient(circle at 82% 0%,rgba(137,116,255,.34),transparent 28%),
    radial-gradient(circle at 8% 120%,rgba(80,203,178,.2),transparent 34%),
    linear-gradient(145deg,#12131d,#1d2030 64%,#28213f) !important;
  box-shadow:0 22px 55px rgba(20,19,40,.2);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy::after { opacity:.52; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn {
  color:#11141e;
  background:linear-gradient(135deg,#a6f2e1,#62cdb8);
  box-shadow:0 9px 22px rgba(80,203,178,.17);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
  border-color:rgba(32,34,50,.08);
  background:#fdfdfc;
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack > div { background:linear-gradient(135deg,#fdfdfc,#f4f2ee); }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel { gap:9px; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel {
  border:1px solid rgba(32,34,50,.08);
  border-radius:14px;
  background:#fdfdfc !important;
  box-shadow:0 9px 24px rgba(25,26,43,.045);
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel::after {
  height:2px;
  background:#e3e0da !important;
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric {
  color:#fff;
  border-color:#171925;
  background:linear-gradient(145deg,#171925,#282b3b) !important;
}
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric::after { background:linear-gradient(90deg,#8a78ef,#59cbb3) !important; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric strong { color:#fff; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel strong { color:#1c1e2a; font-weight:900; letter-spacing:-.035em; }
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-flow-panel,
body.dealfinds-theme .workspace:has(#dashboardView.active) .panel { border-radius:18px; }
body.dealfinds-theme .atlas-map { border-color:#e7e3dc; border-radius:14px; filter:saturate(.82) contrast(.98); }
body.dealfinds-theme .signal-strip span { border-color:#e3e0da; color:#424553; background:#f7f6f3; }

/* Customer detail becomes a premium deal dossier. */
body.dealfinds-theme .detail-hero-card {
  min-height:198px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:22px;
  color:#fff;
  background:
    radial-gradient(circle at 88% 12%,rgba(138,120,239,.34),transparent 30%),
    radial-gradient(circle at 8% 110%,rgba(80,203,178,.18),transparent 32%),
    linear-gradient(145deg,#12131d,#1c1f2e 60%,#28223f) !important;
  box-shadow:0 24px 60px rgba(21,20,38,.2);
}
body.dealfinds-theme .detail-hero-card::after {
  width:44%;
  background:
    linear-gradient(120deg,transparent 0 57%,rgba(255,255,255,.055) 57% 58%,transparent 58%),
    radial-gradient(circle at 70% 35%,rgba(80,203,178,.13),transparent 35%);
}
body.dealfinds-theme .detail-hero-card h3 { color:#fff; font-weight:900; letter-spacing:-.045em; }
body.dealfinds-theme .detail-hero-card > div > span { color:#b8bdcb; }
body.dealfinds-theme .detail-hero-card .tag { border-color:rgba(255,255,255,.11); color:#dedbf8; background:rgba(255,255,255,.07); }
body.dealfinds-theme .detail-hero-score {
  background:
    radial-gradient(circle at center,#151724 0 54%,transparent 55%),
    conic-gradient(#8b79ef,#58cdb5,#c7a96f,#8b79ef);
  box-shadow:0 18px 46px rgba(0,0,0,.23);
}
body.dealfinds-theme .profile-signal,
body.dealfinds-theme .opportunity-next-grid > div,
body.dealfinds-theme .metric-panel,
body.dealfinds-theme .automation-stat,
body.dealfinds-theme .opportunity-stage-card,
body.dealfinds-theme .opportunity-agent-card,
body.dealfinds-theme .opportunity-action-item {
  border-color:rgba(32,34,50,.075) !important;
  background:#f7f6f3 !important;
}
body.dealfinds-theme .score-ring {
  background:radial-gradient(circle at center,#fdfdfc 58%,transparent 59%),conic-gradient(#7b6be0 var(--score-angle),#e3e1dc 0);
  box-shadow:inset 0 0 0 1px rgba(32,34,50,.04);
}
body.dealfinds-theme .opportunity-timeline-item { border-left-color:#7b6be0; background:#f7f6f3; }
body.dealfinds-theme .opportunity-collapse-state { border-color:#ded9f3; color:#6256b5; background:#f2effb; }

/* Admin receives the same restrained hierarchy. */
body.dealfinds-theme .admin-topbar { border-radius:18px; box-shadow:0 14px 40px rgba(25,26,43,.055); }
body.dealfinds-theme .admin-metric-card strong { color:#171925; font-weight:900; letter-spacing:-.04em; }
body.dealfinds-theme .admin-nav-btn:hover,
body.dealfinds-theme .admin-nav-btn.active { color:#fff; background:rgba(255,255,255,.065); box-shadow:inset 2px 0 0 #8877f2; }

/* Redemption-code console */
.admin-redemption-layout { align-items: start; }
.admin-redemption-generator-panel { grid-column: 1 / 7; }
.admin-billing-settings-panel { grid-column: 7 / -1; }
.admin-redemption-list-panel { grid-column: 1 / -1; }
.admin-redemption-list { display: grid; gap: 8px; }
.admin-redemption-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,.04);
}
.admin-redemption-item.available { border-color: rgba(72,216,223,.24); }
.admin-redemption-item.redeemed { opacity: .72; }
.admin-redemption-main { min-width: 0; }
.admin-redemption-main code { display: block; color: var(--text); font-weight: 850; letter-spacing: .04em; word-break: break-all; }
.admin-redemption-main span,
.admin-redemption-main small { display: block; margin-top: 4px; color: var(--muted); }
.admin-redemption-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.admin-redemption-actions .status-pill { white-space: nowrap; }
#adminGeneratedRedemptions { min-height: 152px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; }
#adminBillingSettingsStatus { min-height: 20px; margin: 0; }

.license-entry-switch { display: inline-flex; gap: 6px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); }
.license-entry-tab { min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.license-entry-tab.active { color: var(--text); background: rgba(123,107,224,.16); box-shadow: inset 0 0 0 1px rgba(123,107,224,.22); }
.redemption-store-link { margin: 12px 0 0; color: var(--muted); font-size: .84rem; }
.redemption-store-link a { color: var(--accent, #7b6be0); font-weight: 850; text-decoration: none; }
.redemption-store-link a:hover { text-decoration: underline; }

/* When one opening method is selected, keep the method card and status card
   in a balanced two-column layout instead of leaving a large empty column. */
#licenseView .settings-grid.license-entry-redeem-active,
#licenseView .settings-grid.license-entry-payment-active { align-items: start; }
#licenseView .settings-grid.license-entry-redeem-active > .panel:first-child { grid-column: 1; grid-row: 1; }
#licenseView .settings-grid.license-entry-redeem-active > .panel:nth-child(3) { grid-column: 2; grid-row: 1; }
#licenseView .settings-grid.license-entry-payment-active > .billing-panel { grid-column: 1; grid-row: 1; }
#licenseView .settings-grid.license-entry-payment-active > .panel:nth-child(3) { grid-column: 2; grid-row: 1; }

@media (max-width: 980px) {
  #licenseView .settings-grid.license-entry-redeem-active,
  #licenseView .settings-grid.license-entry-payment-active {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .admin-redemption-generator-panel,
  .admin-billing-settings-panel,
  .admin-redemption-list-panel { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  #licenseView .settings-grid.license-entry-redeem-active,
  #licenseView .settings-grid.license-entry-payment-active { grid-template-columns: 1fr; }
  #licenseView .settings-grid.license-entry-redeem-active > .panel:nth-child(3),
  #licenseView .settings-grid.license-entry-payment-active > .panel:nth-child(3) { grid-column: 1; grid-row: 2; }
  .admin-redemption-item { align-items: flex-start; flex-direction: column; }
  .admin-redemption-actions { width: 100%; justify-content: space-between; }
}

/* ========================================================================== 
   DealFinds product architecture — hierarchy, space and interaction
   ========================================================================== */
body.dealfinds-theme .sidebar-brand {
  position: relative;
  padding-right: 38px;
}
body.dealfinds-theme .sidebar-collapse-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 9px;
  color: #a8afc5;
  background: rgba(255,255,255,.045);
  transform: translateY(-50%);
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
body.dealfinds-theme .sidebar-collapse-btn:hover {
  color: #fff;
  background: rgba(255,255,255,.1);
}
body.dealfinds-theme #workspace {
  transition: grid-template-columns .24s cubic-bezier(.2,.8,.2,1);
}
body.dealfinds-theme #workspace.sidebar-collapsed {
  grid-template-columns: 76px minmax(0,1fr) !important;
}
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar {
  padding-left: 9px;
  padding-right: 9px;
}
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar-brand {
  justify-content: center;
  padding: 7px 0 44px;
}
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar-brand > div,
body.dealfinds-theme #workspace.sidebar-collapsed .nav-section > p,
body.dealfinds-theme #workspace.sidebar-collapsed .nav-module-toggle,
body.dealfinds-theme #workspace.sidebar-collapsed .nav-submenu,
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar-account,
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar-status {
  display: none !important;
}
body.dealfinds-theme #workspace.sidebar-collapsed .sidebar-collapse-btn {
  top: auto;
  right: 50%;
  bottom: 7px;
  transform: translateX(50%);
}
body.dealfinds-theme #workspace.sidebar-collapsed .nav-module-row { grid-template-columns: 1fr; }
body.dealfinds-theme #workspace.sidebar-collapsed .nav-btn {
  grid-template-columns: 1fr !important;
  justify-items: center;
  width: 46px;
  min-height: 44px;
  margin: 0 auto;
  padding: 0 !important;
  font-size: 0 !important;
}
body.dealfinds-theme #workspace.sidebar-collapsed .nav-btn span {
  width: 26px !important;
  height: 26px !important;
  display: grid;
  place-items: center;
  font-size: 1rem !important;
}

body.dealfinds-theme .view.active {
  animation: dealfindsViewIn .24s cubic-bezier(.2,.75,.25,1) both;
}
@keyframes dealfindsViewIn {
  from { opacity: .01; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
body.dealfinds-theme button,
body.dealfinds-theme a,
body.dealfinds-theme .panel,
body.dealfinds-theme .identity-block {
  transition: border-color .18s ease, background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
body.dealfinds-theme button:focus-visible,
body.dealfinds-theme a:focus-visible,
body.dealfinds-theme summary:focus-visible {
  outline: 3px solid rgba(119,103,232,.2);
  outline-offset: 2px;
}
body.dealfinds-theme .panel:not(.detail-panel):hover {
  box-shadow: 0 2px 2px rgba(20,21,33,.025),0 18px 48px rgba(25,26,43,.07);
}
body.dealfinds-theme table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 46px;
  backdrop-filter: blur(12px);
}
body.dealfinds-theme table tbody td { min-height: 54px; padding-top: 13px; padding-bottom: 13px; }
body.dealfinds-theme .empty-state { border-radius: 16px; }
body.dealfinds-theme .opportunity-collapsible-summary { min-height: 82px; }

/* The overview is a scrollable executive workspace, not a compressed wall. */
@media (min-width: 1180px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .route-tabs { display: none; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .route-shell { min-height: 58px; padding-bottom: 0; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .main { padding: 16px 20px 44px; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command {
    display: grid !important;
    grid-template-columns: minmax(0,1fr) !important;
    grid-template-rows: auto !important;
    grid-template-areas: none !important;
    gap: 18px !important;
    width: 100%;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) minmax(300px,.38fr) !important;
    gap: 14px !important;
    min-height: 164px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    width: auto !important;
    height: auto !important;
    min-height: 164px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
    display: block !important;
    padding: 24px 26px !important;
    overflow: hidden;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy .eyebrow {
    margin: 0 0 7px !important;
    font-size: .67rem !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    max-width: 620px;
    margin: 0 !important;
    font-size: clamp(2rem,3vw,3.25rem) !important;
    line-height: 1.02 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    display: block !important;
    max-width: 600px;
    margin-top: 10px;
    font-size: .9rem;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions {
    position: static !important;
    display: flex !important;
    margin-top: 17px !important;
    transform: none !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    min-height: 52px !important;
    padding: 11px 16px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack span { font-size: .68rem !important; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack strong { font-size: .86rem !important; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-topology {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0,1.45fr) minmax(330px,.55fr) !important;
    gap: 18px !important;
    align-items: stretch;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card {
    grid-area: auto !important;
    display: grid !important;
    grid-template-rows: auto minmax(360px,1fr) auto !important;
    height: auto !important;
    min-height: 510px !important;
    padding: 18px !important;
    overflow: visible !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map-head {
    min-height: 48px;
    padding: 0 0 12px;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map {
    height: 390px !important;
    min-height: 390px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map svg {
    width: 100%;
    height: 100% !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip {
    display: grid !important;
    grid-template-columns: repeat(5,minmax(0,1fr)) !important;
    gap: 8px;
    margin-top: 12px;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: 126px 1fr !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    min-height: 510px !important;
    padding: 16px !important;
    border: 1px solid rgba(32,34,50,.08) !important;
    background: #fdfdfc !important;
    box-shadow: 0 14px 40px rgba(25,26,43,.055) !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric {
    width: auto !important;
    height: 126px !important;
    min-height: 126px !important;
    padding: 18px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-template-rows: repeat(3,minmax(0,1fr)) !important;
    gap: 10px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics .metric-panel {
    width: auto !important;
    height: auto !important;
    min-height: 102px !important;
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px !important;
    padding: 14px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel small {
    font-size: .72rem !important;
    white-space: normal !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel strong {
    font-size: 1.65rem !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric strong {
    font-size: 2.65rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0,1.35fr) minmax(280px,.72fr) minmax(280px,.72fr) !important;
    gap: 18px !important;
    min-height: 390px !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid > .panel {
    grid-area: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 390px !important;
    padding: 18px !important;
    overflow: hidden;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel .trend-chart { min-height: 292px !important; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel svg { height: 285px !important; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 18px !important;
    align-items: stretch;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .panel {
    grid-area: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 280px !important;
    padding: 18px !important;
    overflow: hidden;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .tracking-panel {
    grid-column: span 2;
  }
}

/* ========================================================================== 
   Dynamic 3D customer globe
   ========================================================================== */
.atlas-globe-shell {
  position: relative;
  isolation: isolate;
  /* `hidden` still creates a programmatically scrollable box. Focus/click
     helpers could therefore shift every overlay inside the globe. `clip`
     keeps the scene cropped without introducing a second scroll owner. */
  overflow: clip !important;
  cursor: grab;
  background:
    radial-gradient(circle at 50% 48%, rgba(63, 86, 160, .3), transparent 34%),
    radial-gradient(circle at 12% 12%, rgba(80, 203, 178, .14), transparent 30%),
    linear-gradient(145deg, #070a14 0%, #10162b 52%, #090c18 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(153, 166, 230, .12),
    inset 0 -80px 130px rgba(2, 4, 12, .42),
    0 24px 55px rgba(25, 26, 43, .09);
  user-select: none;
  touch-action: pan-y;
}

.atlas-globe-shell:active { cursor: grabbing; }

.atlas-globe-shell::before,
.atlas-globe-shell::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
}

.atlas-globe-shell::before {
  inset: 0;
  background:
    linear-gradient(rgba(117, 139, 205, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(117, 139, 205, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 50%, #000 0 44%, transparent 78%);
}

.atlas-globe-shell::after {
  inset: auto 8% -24% 8%;
  height: 42%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(80, 203, 178, .16), rgba(119, 103, 232, .06) 48%, transparent 72%);
  filter: blur(28px);
}

.atlas-globe-fallback {
  position: relative;
  z-index: 1;
  opacity: .72;
  transition: opacity .35s ease;
}

.atlas-globe-shell.is-3d-ready .atlas-globe-fallback {
  opacity: 0;
  pointer-events: none;
}

.atlas-globe-canvas {
  position: absolute;
  z-index: 2;
  inset: 0;
}

.atlas-globe-canvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: 0;
}

.atlas-globe-hud {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.atlas-globe-live {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid rgba(136, 243, 218, .18);
  border-radius: 999px;
  color: #dffdf6;
  background: rgba(9, 17, 31, .62);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
  backdrop-filter: blur(14px);
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .04em;
}

.atlas-globe-live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #65e1c8;
  box-shadow: 0 0 0 5px rgba(101, 225, 200, .09), 0 0 16px rgba(101, 225, 200, .72);
  animation: globeLivePulse 2s ease-in-out infinite;
}

@keyframes globeLivePulse {
  50% { transform: scale(.78); opacity: .68; }
}

.atlas-globe-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 6px;
}

.atlas-globe-stat-grid > div {
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 7px 9px;
  border: 1px solid rgba(167, 177, 229, .12);
  border-radius: 10px;
  color: #fff;
  background: rgba(8, 13, 27, .55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 12px 28px rgba(0,0,0,.12);
  backdrop-filter: blur(14px);
}

.atlas-globe-stat-grid span {
  color: #8d9ab8;
  font-size: .56rem;
  font-weight: 760;
}

.atlas-globe-stat-grid strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.atlas-globe-label-layer {
  position: absolute;
  z-index: 4;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.atlas-globe-label {
  position: absolute;
  left: 0;
  top: 0;
  max-width: 160px;
  padding: 5px 8px;
  border: 1px solid rgba(164, 177, 229, .16);
  border-radius: 8px;
  color: #eef3ff;
  background: rgba(6, 11, 24, .68);
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  backdrop-filter: blur(10px);
  font-size: .65rem;
  font-weight: 820;
  line-height: 1;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: opacity .16s ease;
}

.atlas-globe-label b {
  margin-left: 5px;
  color: #75e6cf;
  font-size: .7rem;
}

.atlas-globe-tooltip {
  position: absolute;
  z-index: 8;
  min-width: 190px;
  max-width: 250px;
  padding: 12px 13px;
  border: 1px solid rgba(139, 153, 222, .2);
  border-radius: 13px;
  color: #f3f5ff;
  background: rgba(7, 11, 24, .88);
  box-shadow: 0 18px 46px rgba(0,0,0,.32);
  backdrop-filter: blur(18px);
  pointer-events: none;
}

.atlas-globe-tooltip strong {
  display: block;
  margin-bottom: 7px;
  font-size: .86rem;
}

.atlas-globe-tooltip span {
  display: block;
  color: #aab4cf;
  font-size: .7rem;
  line-height: 1.65;
}

.atlas-globe-tooltip em {
  color: #79e4ce;
  font-style: normal;
  font-weight: 850;
}

.atlas-globe-legend {
  position: absolute;
  z-index: 5;
  left: 18px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 8px 11px;
  border: 1px solid rgba(157, 168, 222, .11);
  border-radius: 10px;
  color: #9ca8c5;
  background: rgba(6, 11, 24, .56);
  backdrop-filter: blur(12px);
  font-size: .64rem;
  font-weight: 720;
  pointer-events: none;
}

.atlas-globe-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.globe-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  box-shadow: 0 0 12px currentColor;
}

.globe-dot-hot { color: #ffb45d; background: currentColor; }
.globe-dot-active { color: #65e1c8; background: currentColor; }
.globe-dot-new { color: #8e7df1; background: currentColor; }

.atlas-globe-rotation {
  position: absolute;
  z-index: 7;
  right: 16px;
  bottom: 15px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(164, 177, 229, .16);
  border-radius: 10px;
  color: #dce3f7;
  background: rgba(7, 12, 25, .66);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045);
  backdrop-filter: blur(12px);
  font-size: .68rem;
  font-weight: 820;
}

.atlas-globe-rotation:hover {
  border-color: rgba(101, 225, 200, .34);
  color: #8ff1dd;
  background: rgba(12, 23, 38, .82);
}

.atlas-globe-rotation[aria-pressed="true"] {
  color: #ffcf89;
  border-color: rgba(255, 180, 93, .28);
}

@media (max-width: 820px) {
  .atlas-globe-stat-grid { grid-template-columns: repeat(3, minmax(60px, 1fr)); }
  .atlas-globe-stat-grid > div { min-height: 44px; padding: 6px 7px; }
  .atlas-globe-stat-grid span { font-size: .52rem; }
  .atlas-globe-stat-grid strong { font-size: .9rem; }
  .atlas-globe-legend { display: none; }
  .atlas-globe-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .atlas-globe-live i { animation: none; }
}

/* ==========================================================================\n+   Authentication polish: compact card + the same live globe used by the\n+   workspace.  This block intentionally comes last so older auth experiments\n+   above cannot re-expand the login panel on desktop.\n+   ========================================================================== */
@media (min-width: 981px) {
  body:has(#authShell:not([hidden])) .auth-shell {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 430px);
    gap: clamp(18px, 2vw, 30px);
    padding: 24px clamp(24px, 3.2vw, 52px);
    box-sizing: border-box;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  body:has(#authShell:not([hidden])) .auth-visual-panel {
    min-width: 0;
    height: 100%;
    min-height: 0;
    max-height: 100%;
  }

  body:has(#authGlobePreview) .auth-visual-panel {
    padding-top: 30px;
    padding-bottom: 30px;
    grid-template-rows: minmax(310px, 1fr) auto;
    align-content: stretch;
    gap: 16px;
  }

  body:has(#authShell:not([hidden])) .auth-brand-lockup h1 {
    max-width: 680px;
    font-size: clamp(3rem, 5.2vw, 5.4rem);
    line-height: .98;
  }

  body:has(#authShell:not([hidden])) .auth-brand-lockup span {
    max-width: 560px;
    font-size: clamp(.92rem, 1.05vw, 1.08rem);
    line-height: 1.55;
  }

  body:has(#authShell:not([hidden])) .auth-showcase {
    width: min(780px, 88%);
    margin-left: clamp(8px, 3.5vw, 54px);
    transform: translateY(28px);
    height: max-content;
    min-height: 0;
  }

  body:has(#authShell:not([hidden])) .auth-preview-map {
    min-height: 286px;
  }

  /* Keep the command preview square to the viewport; the earlier tilted
     perspective made the globe look cropped and pushed the lower edge under
     the now-removed proof cards. */
  body:has(#authShell:not([hidden])) .auth-showcase::after {
    display: none;
  }

  body:has(#authShell:not([hidden])) .auth-card {
    width: 100%;
    max-height: calc(100dvh - 48px);
    box-sizing: border-box;
    margin: 0;
    padding: 22px 24px 17px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-gutter: stable;
    border-radius: 22px;
  }

  body:has(#authShell:not([hidden])) .auth-card-badge {
    padding: 6px 10px;
    font-size: .72rem;
  }

  body:has(#authShell:not([hidden])) .auth-card-head {
    margin-top: 10px;
  }

  body:has(#authShell:not([hidden])) .auth-card-head h2 {
    margin: 3px 0 7px;
    font-size: clamp(2rem, 2.35vw, 2.45rem);
    line-height: 1.05;
  }

  body:has(#authShell:not([hidden])) .auth-card-head > span {
    display: block;
    font-size: .82rem;
    line-height: 1.42;
  }

  body:has(#authShell:not([hidden])) .auth-tabs {
    margin-top: 13px;
    padding: 3px;
  }

  body:has(#authShell:not([hidden])) .auth-tabs button {
    min-height: 36px;
  }

  body:has(#authShell:not([hidden])) .auth-form {
    margin-top: 13px;
    gap: 9px;
  }

  body:has(#authShell:not([hidden])) .auth-form label {
    font-size: .82rem;
  }

  body:has(#authShell:not([hidden])) .auth-form input {
    min-height: 46px;
    margin-top: 5px;
    padding: 0 13px;
    border-radius: 10px;
  }

  body:has(#authShell:not([hidden])) .auth-card .primary-btn {
    min-height: 48px;
    margin-top: 2px;
    border-radius: 12px;
  }

  body:has(#authShell:not([hidden])) .auth-challenge-panel {
    grid-template-columns: minmax(0, 1fr) 102px auto;
    gap: 8px;
    margin-top: 12px;
    padding: 10px;
    border-radius: 14px;
  }

  body:has(#authShell:not([hidden])) .auth-challenge-panel strong {
    font-size: .92rem;
  }

  body:has(#authShell:not([hidden])) .auth-challenge-panel input {
    min-height: 38px;
    padding: 0 9px;
    border-radius: 10px;
    font-size: .78rem;
  }

  body:has(#authShell:not([hidden])) .auth-challenge-panel .ghost-btn {
    min-height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    font-size: .75rem;
  }

  body:has(#authShell:not([hidden])) .auth-secondary-action {
    margin-top: 8px;
    font-size: .78rem;
  }

  body:has(#authShell:not([hidden])) .auth-security-row {
    display: grid !important;
    margin-top: 12px;
  }

  body:has(#authShell:not([hidden])) .auth-security-row span {
    min-height: 30px;
    font-size: .67rem;
  }

  body:has(#authShell:not([hidden])) .auth-device-strip {
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: .68rem;
  }

  body:has(#authShell:not([hidden])) .auth-device-strip code {
    max-width: 58%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .64rem;
  }
}

.auth-globe-preview {
  min-height: 286px;
  border-radius: 17px !important;
  border-color: rgba(144, 162, 231, .18) !important;
  background:
    radial-gradient(circle at 50% 48%, rgba(63, 86, 160, .34), transparent 34%),
    linear-gradient(145deg, #070a14 0%, #10162b 52%, #090c18 100%) !important;
}

.auth-globe-preview .atlas-globe-label-layer {
  opacity: 0;
}

.auth-globe-fixed-labels {
  position: absolute;
  z-index: 6;
  inset: 0;
  pointer-events: none;
  color: #eef3ff;
  font-size: .64rem;
  font-weight: 820;
}

.auth-globe-fixed-label {
  position: absolute;
  padding: 5px 8px 5px 10px;
  border: 1px solid rgba(164, 177, 229, .2);
  border-radius: 8px;
  background: rgba(6, 11, 24, .7);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.auth-globe-fixed-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: #65e1c8;
  box-shadow: 0 0 12px rgba(101, 225, 200, .86);
  vertical-align: 1px;
}

.auth-globe-label-us { left: 8%; top: 38%; }
.auth-globe-label-eu { right: 11%; top: 25%; }
.auth-globe-label-source { right: 7%; bottom: 15%; }
.auth-globe-label-source::before { background: #ffb45d; box-shadow: 0 0 12px rgba(255, 180, 93, .86); }

.auth-globe-preview-caption {
  position: absolute;
  z-index: 6;
  left: 13px;
  bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #aab4cf;
  font-size: .59rem;
  font-weight: 760;
  pointer-events: none;
}

.auth-globe-preview-caption i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #65e1c8;
  box-shadow: 0 0 10px rgba(101, 225, 200, .84);
}

@media (max-width: 980px) {
  .auth-globe-preview { min-height: min(286px, 30vh); }
  .auth-globe-label-us { left: 4%; }
  .auth-globe-label-eu { right: 4%; }
}

@media (min-width: 981px) and (max-height: 790px) {
  body:has(#authGlobePreview) .auth-visual-panel {
    padding-top: 24px;
    padding-bottom: 24px;
    grid-template-rows: minmax(280px, 1fr) auto;
    gap: 18px;
  }

  body:has(#authGlobePreview) .auth-preview-map,
  body:has(#authGlobePreview) .auth-globe-preview {
    min-height: 220px;
  }
}

@media (min-width: 981px) and (max-height: 860px) {
  body:has(#authGlobePreview) .auth-visual-panel {
    padding-top: 24px;
    padding-bottom: 24px;
    grid-template-rows: minmax(260px, 1fr) auto;
    gap: 16px;
  }

  body:has(#authGlobePreview) .auth-brand-lockup h1 {
    font-size: clamp(2.8rem, 4.5vw, 4.6rem);
  }

  body:has(#authGlobePreview) .auth-brand-lockup span {
    font-size: .92rem;
    line-height: 1.45;
  }

  body:has(#authGlobePreview) .auth-preview-map,
  body:has(#authGlobePreview) .auth-globe-preview {
    min-height: 220px !important;
  }

  body:has(#authGlobePreview) .auth-preview-stat {
    min-height: 56px;
  }
}

@media (max-width: 1179px) {
  body.dealfinds-theme .sidebar-collapse-btn { display:none; }
}

/* ========================================================================== 
   DealFinds Command Center v3 — spacious Bento dashboard + real page scroll
   ========================================================================== */

/* Keep one predictable scroll owner. Inner dashboard cards must never trap the
   wheel or crop business data. */
body.dealfinds-theme:has(#workspace:not([hidden])) {
  overflow: hidden !important;
}

body.dealfinds-theme #workspace:not([hidden]) {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

body.dealfinds-theme #workspace:not([hidden]) > .main {
  height: 100dvh !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: scroll !important;
  overscroll-behavior-y: auto !important;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(105, 91, 188, .62) rgba(26, 28, 42, .07);
  touch-action: pan-y;
}

body.dealfinds-theme #workspace:not([hidden]) > .main::-webkit-scrollbar {
  width: 11px;
}

body.dealfinds-theme #workspace:not([hidden]) > .main::-webkit-scrollbar-track {
  background: rgba(26, 28, 42, .055);
}

body.dealfinds-theme #workspace:not([hidden]) > .main::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, #7767e8, #50cbb2) padding-box;
}

body.dealfinds-theme #workspace:not([hidden]) #dashboardView.active,
body.dealfinds-theme #workspace:not([hidden]) #dashboardView.active .atlas-command {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

@media (min-width: 1024px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .main {
    padding: 18px 22px 64px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    grid-template-areas: none !important;
    gap: 20px !important;
    width: min(100%, 1760px);
    margin: 0 auto;
  }

  /* Hero: narrative on the left, compact operating status on the right. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(290px, .78fr) !important;
    gap: 16px !important;
    height: auto !important;
    min-height: 178px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    width: auto !important;
    height: auto !important;
    min-height: 178px !important;
    max-height: none !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    padding: 26px 30px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    margin: 4px 0 0 !important;
    font-size: clamp(2.15rem, 3vw, 3.45rem) !important;
    line-height: 1.02 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    display: block !important;
    margin-top: 10px;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions {
    position: static !important;
    display: flex !important;
    margin-top: 18px !important;
    transform: none !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: repeat(3, minmax(0, 1fr)) !important;
    gap: 1px !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    min-height: 58px !important;
    padding: 12px 18px !important;
  }

  /* KPI rail is now above the map. All seven metrics have their own card and
     their content controls the height. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-topology {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-areas:
      "metrics"
      "map" !important;
    gap: 16px !important;
    align-items: start !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-area: metrics !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    display: contents !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric {
    width: auto !important;
    height: auto !important;
    min-height: 112px !important;
    max-height: none !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    gap: 5px !important;
    padding: 16px 18px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel small {
    max-width: 100%;
    margin: 0 !important;
    overflow: visible !important;
    font-size: .72rem !important;
    line-height: 1.25 !important;
    text-overflow: clip !important;
    white-space: normal !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel strong {
    margin: 0 !important;
    font-size: clamp(1.7rem, 2.15vw, 2.35rem) !important;
    line-height: 1 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card {
    grid-area: map !important;
    display: grid !important;
    grid-template-rows: auto auto auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map {
    width: 100%;
    height: auto !important;
    min-height: 360px !important;
    aspect-ratio: 900 / 360;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map svg {
    width: 100%;
    height: 100% !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 8px;
    margin-top: 12px;
  }

  /* Work bento: the analytical chart anchors the left; action and task cards
     form a useful vertical command stack on the right. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 7fr) minmax(310px, 5fr) !important;
    grid-template-rows: auto auto !important;
    grid-template-areas:
      "chart activity"
      "chart tasks" !important;
    gap: 16px !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: stretch;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel { grid-area: chart !important; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-activity-panel { grid-area: activity !important; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel { grid-area: tasks !important; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid > .panel {
    width: auto !important;
    height: auto !important;
    min-height: 220px !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel {
    min-height: 456px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel .trend-chart {
    height: auto !important;
    min-height: 360px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel svg {
    width: 100%;
    height: 328px !important;
    min-height: 0 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .activity-feed,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel .task-stream {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  /* Intelligence bento: 5/4/3, then three equal cards, then a full-width
     tracking workspace. No card or list clips its records. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid {
    grid-area: auto !important;
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    gap: 16px !important;
    height: auto !important;
    min-height: 0 !important;
    align-items: stretch;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .panel {
    grid-area: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 300px !important;
    max-height: none !important;
    padding: 20px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .priority-panel {
    display: block !important;
    grid-area: 1 / 1 / 2 / span 5 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .source-board-panel {
    display: block !important;
    grid-area: 1 / 6 / 2 / span 4 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .pipeline-panel {
    display: block !important;
    grid-area: 1 / 10 / 2 / -1 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .market-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .template-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .risk-panel {
    display: block !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .market-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .template-panel {
    grid-row: 2 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .market-panel {
    grid-column: 1 / span 4 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .template-panel {
    grid-column: 5 / span 4 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .risk-panel {
    grid-area: 2 / 9 / 3 / -1 !important;
  }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .tracking-panel {
    display: block !important;
    grid-area: 3 / 1 / 4 / -1 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid .priority-list,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid .insight-list,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid .funnel-list,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid .alert-list,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid .open-event-list {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head {
    grid-template-columns: minmax(0, 1.55fr) minmax(90px, .82fr) 52px 76px !important;
    gap: 8px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head span {
    display: block !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item {
    min-height: 62px !important;
    grid-template-columns: minmax(0, 1.55fr) minmax(90px, .82fr) 52px 76px !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item > div:first-child,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-meta {
    display: contents !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item > div:first-child span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-meta small {
    display: block !important;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item > div:first-child strong {
    min-width: 0;
    display: -webkit-box !important;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (min-width: 1440px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 1180px) and (max-width: 1439px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item {
    grid-template-columns: minmax(0, 1fr) 52px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(2),
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(4),
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item > div:first-child span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-meta small {
    display: none !important;
  }
}

@media (min-width: 1024px) and (max-width: 1179px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas: "chart" "activity" "tasks" !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .panel {
    grid-area: auto / auto / auto / span 6 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .tracking-panel {
    grid-area: auto / 1 / auto / -1 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item {
    grid-template-columns: minmax(0, 1fr) 52px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(2),
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-table-head span:nth-child(4),
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-item > div:first-child span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .priority-meta small {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  body.dealfinds-theme #workspace:not([hidden]) {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.dealfinds-theme #workspace:not([hidden]) > .main {
    height: auto !important;
    min-height: 100dvh !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    height: auto !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    display: contents !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel {
    height: auto !important;
    min-height: 104px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid > .panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .panel {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ========================================================================== 
   DealFinds Command Center v4 — compact operational cockpit
   The overview keeps the application shell, while the first viewport behaves
   like a business data wall: trend on the left, live globe in the center and
   executable work on the right.
   ========================================================================== */

@media (min-width: 1280px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .main {
    padding: 12px 16px 56px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command {
    display: grid !important;
    grid-template-columns: repeat(12, minmax(0, 1fr)) !important;
    grid-template-rows: auto auto minmax(218px, auto) minmax(218px, auto) auto !important;
    grid-template-areas: none !important;
    gap: 12px !important;
    width: min(100%, 1780px) !important;
    margin: 0 auto !important;
    align-items: stretch !important;
  }

  /* Compact command header. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(450px, 38%) !important;
    gap: 10px !important;
    width: auto !important;
    height: 76px !important;
    min-height: 76px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    align-content: center !important;
    column-gap: 18px !important;
    width: auto !important;
    height: 76px !important;
    min-height: 76px !important;
    padding: 10px 16px !important;
    border-radius: 16px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy .eyebrow {
    grid-column: 1 !important;
    grid-row: 1 !important;
    margin: 0 0 3px !important;
    font-size: .59rem !important;
    letter-spacing: .11em !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    grid-column: 1 !important;
    grid-row: 2 !important;
    margin: 0 !important;
    font-size: clamp(1.3rem, 1.7vw, 1.85rem) !important;
    line-height: 1 !important;
    white-space: nowrap;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy > span {
    display: none !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions {
    grid-column: 2 !important;
    grid-row: 1 / 3 !important;
    position: static !important;
    align-self: center !important;
    display: flex !important;
    gap: 8px !important;
    margin: 0 !important;
    transform: none !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link {
    min-height: 36px !important;
    padding: 0 13px !important;
    border-radius: 10px !important;
    font-size: .72rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: 1fr !important;
    gap: 1px !important;
    width: auto !important;
    height: 76px !important;
    min-height: 76px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack > div {
    display: grid !important;
    align-content: center !important;
    min-width: 0 !important;
    min-height: 76px !important;
    padding: 10px 13px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack span {
    font-size: .59rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack strong {
    overflow: hidden;
    font-size: .74rem !important;
    line-height: 1.25 !important;
    text-overflow: ellipsis;
  }

  /* Flatten the old wrappers so their cards can share one cockpit grid. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-topology,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid {
    display: contents !important;
  }

  /* Seven KPI cards form one concise telemetry rail. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    grid-template-rows: 82px !important;
    gap: 10px !important;
    width: auto !important;
    height: 82px !important;
    min-height: 82px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics {
    display: contents !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .hero-metric {
    --kpi-accent: #5070ee;
    position: relative;
    width: auto !important;
    height: 82px !important;
    min-height: 82px !important;
    max-height: 82px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto auto auto !important;
    align-content: center !important;
    gap: 2px !important;
    padding: 10px 13px !important;
    border: 1px solid #e5e8f0 !important;
    border-top: 3px solid var(--kpi-accent) !important;
    border-radius: 13px !important;
    background: rgba(255,255,255,.9) !important;
    box-shadow: 0 8px 24px rgba(31, 38, 65, .055) !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric {
    --kpi-accent: #59d4c1;
    color: #fff !important;
    border-color: rgba(255,255,255,.08) !important;
    border-top-color: #59d4c1 !important;
    background: linear-gradient(145deg, #17223b, #20243f 64%, #252548) !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(1) { --kpi-accent: #27baa2; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(2) { --kpi-accent: #28ad74; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(3) { --kpi-accent: #5776f4; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(4) { --kpi-accent: #e6a02a; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(5) { --kpi-accent: #775ce2; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-mini-metrics > article:nth-child(6) { --kpi-accent: #eb6674; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel small {
    margin: 0 !important;
    overflow: hidden !important;
    font-size: .64rem !important;
    line-height: 1.15 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel strong {
    margin: 0 !important;
    font-size: clamp(1.35rem, 1.75vw, 1.85rem) !important;
    line-height: .98 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric span,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric small {
    color: #bcc5db !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric strong {
    color: #fff !important;
  }

  /* Main three-column cockpit. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel {
    grid-area: auto !important;
    grid-column: 1 / span 3 !important;
    grid-row: 3 / span 2 !important;
    min-width: 0 !important;
    min-height: 448px !important;
    height: 100% !important;
    padding: 15px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card {
    grid-area: auto !important;
    grid-column: 4 / span 6 !important;
    grid-row: 3 / span 2 !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    min-width: 0 !important;
    min-height: 448px !important;
    height: 100% !important;
    padding: 15px !important;
    border-radius: 16px !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-activity-panel {
    grid-area: auto !important;
    grid-column: 10 / -1 !important;
    grid-row: 3 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel {
    grid-area: auto !important;
    grid-column: 10 / -1 !important;
    grid-row: 4 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-activity-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel {
    min-width: 0 !important;
    min-height: 218px !important;
    height: auto !important;
    padding: 14px !important;
    border-radius: 16px !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-map-head,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid .panel-header {
    min-height: 38px !important;
    margin: 0 0 8px !important;
    padding: 0 0 8px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-map-head h3,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid .panel-header h3 {
    font-size: .92rem !important;
    line-height: 1.1 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-map-head .eyebrow,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-main-grid .eyebrow {
    font-size: .58rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map {
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: auto !important;
    border-radius: 12px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin-top: 8px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .signal-strip span {
    min-height: 28px !important;
    padding: 0 5px !important;
    font-size: .62rem !important;
    white-space: nowrap;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel .trend-chart {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    height: calc(100% - 48px) !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel svg {
    align-self: stretch;
    width: 100% !important;
    height: 100% !important;
    min-height: 270px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .activity-feed,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel .task-stream {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .today-action-item,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .task-stream > * {
    min-height: 52px !important;
  }

  /* Secondary intelligence stays below the cockpit as a compact bento grid. */
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid {
    grid-area: auto !important;
    grid-column: 1 / -1 !important;
    grid-row: 5 !important;
    gap: 12px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .panel {
    min-height: 248px !important;
    padding: 16px !important;
    border-radius: 16px !important;
  }
}

@media (min-width: 1280px) and (max-width: 1439px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero {
    grid-template-columns: minmax(0, 1fr) minmax(420px, 42%) !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack strong {
    font-size: .68rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel {
    padding-inline: 10px !important;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .main {
    padding: 14px 16px 56px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    grid-template-areas: none !important;
    gap: 16px !important;
    width: 100% !important;
    min-height: 0 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-hero,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-kpi-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-visual-card,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-chart-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-activity-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .running-task-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-lower-grid {
    grid-area: auto !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-hero { order: 1; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-kpi-panel { order: 2; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-visual-card { order: 3; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-chart-panel { order: 4; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-activity-panel { order: 5; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .running-task-panel { order: 6; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-lower-grid { order: 7; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(280px, .72fr) !important;
    gap: 12px !important;
    width: auto !important;
    height: auto !important;
    min-height: 118px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-status-stack {
    min-height: 118px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-copy h1 {
    font-size: 1.65rem !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-template-rows: auto !important;
    height: auto !important;
    min-height: 0 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel .metric-panel {
    min-height: 96px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-visual-card .atlas-map {
    min-height: 380px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-activity-panel,
  body.dealfinds-theme .workspace:has(#dashboardView.active) .running-task-panel {
    min-height: 260px !important;
    overflow: visible !important;
  }
}

@media (max-width: 1023px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    width: 100% !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-hero { order: 1; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-kpi-panel { order: 2; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .atlas-visual-card { order: 3; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-chart-panel { order: 4; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-activity-panel { order: 5; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .running-task-panel { order: 6; }
  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > .command-lower-grid { order: 7; }

  body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-command > * {
    grid-area: auto !important;
    width: 100% !important;
    min-width: 0 !important;
  }
}

@media (min-width: 1280px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) :is(.command-chart-panel, .command-activity-panel, .running-task-panel) .panel-header {
    min-height: 38px !important;
    margin: 0 0 8px !important;
    padding: 0 0 8px !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) :is(.command-chart-panel, .command-activity-panel, .running-task-panel) .panel-header h3 {
    font-size: .92rem !important;
    line-height: 1.1 !important;
  }

  body.dealfinds-theme .workspace:has(#dashboardView.active) :is(.command-chart-panel, .command-activity-panel, .running-task-panel) .eyebrow {
    font-size: .58rem !important;
  }
}

.trend-chart {
  position: relative;
}

.trend-plot {
  position: relative;
  min-width: 0;
  min-height: 190px;
  overflow: hidden;
}

.trend-plot > svg {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
}

.trend-date-axis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: center;
  padding: 5px 2px 0;
  color: #78849a;
  font-size: .56rem;
  font-weight: 680;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.trend-chart-empty {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: grid;
  place-items: center;
  color: #8994aa;
  font-size: .7rem;
  font-weight: 720;
  letter-spacing: .02em;
  pointer-events: none;
}

.trend-chart-empty[hidden] {
  display: none;
}

@media (min-width: 1280px) {
  body.dealfinds-theme .workspace:has(#dashboardView.active) .command-chart-panel .trend-chart {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }
}

/* Email open tracking keeps running in the backend; the duplicated technical
   panel is removed from the overview to keep the cockpit business-focused. */
body.dealfinds-theme .workspace:has(#dashboardView.active) .command-lower-grid > .tracking-panel {
  display: none !important;
}

/* Keep the two dashboard shortcuts visually equal. */
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .primary-btn,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-hero-actions .panel-link {
  width: 108px !important;
  min-width: 108px !important;
  min-height: 36px !important;
  height: 36px !important;
  margin: 0 !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(127, 232, 213, .52) !important;
  border-radius: 10px !important;
  color: #10253a !important;
  background: linear-gradient(135deg, #8ce7d4, #72d9c8) !important;
  box-shadow: 0 8px 20px rgba(38, 184, 158, .18) !important;
  font-size: .72rem !important;
  font-weight: 820 !important;
}

/* The total lead count is part of the same KPI rail, so use the same card
   surface while retaining its teal accent for quick recognition. */
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric {
  --kpi-accent: #59d4c1;
  color: #17213a !important;
  border-color: #e5e8f0 !important;
  border-top-color: var(--kpi-accent) !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: 0 8px 24px rgba(31, 38, 65, .055) !important;
}

body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric span,
body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric small {
  color: #6f7b91 !important;
}

body.dealfinds-theme .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric strong {
  color: #17213a !important;
}

body.dealfinds-theme[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric {
  color: var(--solid-dark-text) !important;
  border-color: var(--solid-dark-line-soft) !important;
  border-top-color: var(--kpi-accent) !important;
  background: var(--solid-dark-panel-2) !important;
  box-shadow: none !important;
}

body.dealfinds-theme[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric span,
body.dealfinds-theme[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric small {
  color: #91a6bc !important;
}

body.dealfinds-theme[data-theme="dark"] .workspace:has(#dashboardView.active) .atlas-kpi-panel > .hero-metric strong {
  color: var(--solid-dark-text) !important;
}
