: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.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-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;
}

.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;
}

.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;
}

#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: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(142, 165, 151, 0.17);
  border-radius: var(--radius);
  background: rgba(7, 10, 9, 0.52);
  padding: 12px;
}

.mail-queue-item strong,
.mail-queue-item span,
.mail-queue-item small {
  display: block;
}

.mail-queue-item span,
.mail-queue-item small {
  color: var(--muted);
  margin-top: 4px;
}

.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;
}

.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;
}

.writer-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 10px;
}

.draft-subject-label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.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;
}

.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;
}

#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);
}

.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);
}

.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: start;
}

.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-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;
}

.toolbar input {
  min-width: min(320px, 100%);
}

.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: 1160px;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(142, 165, 151, 0.12);
}

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;
}

tbody tr:hover {
  background: rgba(72, 216, 223, 0.06);
}

.table-company {
  display: grid;
  gap: 3px;
}

.table-company strong {
  color: var(--text);
}

.table-company span {
  color: var(--dim);
  font-size: 0.78rem;
}

.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;
}

.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));
}

.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,
  .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;
  }

  .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,
  .automation-grid,
  .keyword-pack-head {
    grid-template-columns: 1fr;
  }

  #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;
}

.topbar {
  position: sticky;
  top: 0;
  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);
}

.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: 1180px;
  table-layout: fixed;
}

th {
  color: #506171;
  background: #f2f6fa;
  text-transform: none;
  font-weight: 860;
  white-space: nowrap;
}

td {
  color: #263644;
  overflow-wrap: anywhere;
}

th,
td {
  padding: 12px 10px;
}

th:nth-child(1),
td:nth-child(1) {
  width: 22%;
}

th:nth-child(2),
td:nth-child(2) {
  width: 8%;
}

th:nth-child(3),
td:nth-child(3) {
  width: 7%;
}

th:nth-child(4),
td:nth-child(4) {
  width: 21%;
}

th:nth-child(5),
td:nth-child(5) {
  width: 7%;
  text-align: center;
}

th:nth-child(6),
td:nth-child(6),
th:nth-child(7),
td:nth-child(7),
th:nth-child(8),
td:nth-child(8) {
  width: 8%;
}

th:nth-child(9),
td:nth-child(9) {
  width: 8%;
}

th:nth-child(10),
td:nth-child(10) {
  width: 6%;
  text-align: center;
}

.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;
}

.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-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;
}

@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;
  }

  .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,
  .atlas-flow {
    grid-template-columns: 1fr !important;
  }

  .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 {
    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 {
    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) .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: minmax(0, 1.5fr) minmax(340px, 0.85fr);
  gap: 18px;
}

.admin-hero-panel,
.admin-users-panel {
  grid-column: 1 / 2;
}

.admin-license-panel,
.admin-license-list-panel {
  grid-column: 2 / 3;
}

.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-license-form {
  display: grid;
  gap: 12px;
}

.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);
}

.status-pill.success {
  color: #0f8b5f;
  border-color: rgba(34, 185, 129, 0.34);
  background: rgba(34, 185, 129, 0.08);
}

.admin-license-list {
  display: grid;
  gap: 10px;
}

.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-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-license-list-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;
}

.task-stage-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.task-stage-line span,
.task-note {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.task-evidence-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(96px, 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;
}

.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;
}

.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-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.75vw, 1.72rem);
    line-height: 1.12;
  }

  .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.98rem;
    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)) .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 {
    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,
  .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;
  }
}
