﻿/* TabiTrade Generator — Supreme UI v17 + features */
:root {
  --accent: #c026d3;
  --accent-2: #a855f7;
  --accent-soft: rgba(192, 38, 211, 0.12);
  --accent-glow: rgba(192, 38, 211, 0.28);
  --bg: #030308;
  --panel: #0c0c14;
  --panel2: #080810;
  --muted: #9ca3af;
  --text: #f0f0f5;
  --line: #1a1a28;
  --line2: #2a2a3c;
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.1);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.1);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 8px 40px rgba(168, 85, 247, 0.22);
  --shadow-glow-lg: 0 16px 56px rgba(168, 85, 247, 0.28);
  --glass: rgba(10, 10, 18, 0.78);
  --glass-border: rgba(168, 85, 247, 0.2);
  --glass-highlight: rgba(255, 255, 255, 0.09);
  --transition: 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.45, 0.64, 1);
  --supreme-gradient: linear-gradient(135deg, #f0abfc 0%, #c026d3 38%, #7c3aed 72%, #6366f1 100%);
}

*, *::before, *::after { box-sizing: border-box; }
#files { display: none; }

html {
  background-color: var(--bg);
  color-scheme: dark;
}

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  background: transparent;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

html, body { margin: 0; min-height: 100%; }

/* ─── Ambient background (aurora + grid + canvas particles) ─── */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 75% 50% at 50% -8%, rgba(168, 85, 247, 0.28), transparent 62%),
    radial-gradient(ellipse 45% 38% at 100% 88%, rgba(99, 102, 241, 0.2), transparent 55%),
    radial-gradient(ellipse 40% 34% at 0% 72%, rgba(236, 72, 153, 0.16), transparent 52%),
    linear-gradient(180deg, #000000, var(--bg));
}
.ambient-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  pointer-events: none;
}
.ambient-aurora {
  position: absolute;
  inset: -30%;
  opacity: 0.78;
  filter: blur(64px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  background:
    radial-gradient(circle at 18% 28%, rgba(168, 85, 247, 0.38), transparent 42%),
    radial-gradient(circle at 78% 22%, rgba(99, 102, 241, 0.3), transparent 40%),
    radial-gradient(circle at 62% 78%, rgba(236, 72, 153, 0.22), transparent 38%);
  animation: ambient-aurora-drift 22s ease-in-out infinite alternate;
}
.ambient-grid {
  position: absolute;
  inset: 0;
  opacity: 0.55;
  will-change: opacity, transform;
  transform: translate3d(0, 0, 0);
  background-image:
    linear-gradient(rgba(168, 85, 247, 0.13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, 0.13) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 92% 85% at 50% 42%, #000 12%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 92% 85% at 50% 42%, #000 12%, transparent 80%);
  animation: ambient-grid-pulse 8s ease-in-out infinite, ambient-grid-drift 48s linear infinite;
}
.ambient-spotlight {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 1;
  background:
    radial-gradient(220px circle at var(--spot-x, 50%) var(--spot-y, 35%), rgba(232, 121, 249, 0.22), transparent 100%),
    radial-gradient(480px circle at var(--spot-x, 50%) var(--spot-y, 35%), rgba(99, 102, 241, 0.12), transparent 100%),
    radial-gradient(720px circle at var(--spot-x, 50%) var(--spot-y, 35%), rgba(168, 85, 247, 0.06), transparent 100%);
}
.ambient-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  opacity: 0.92;
  pointer-events: none;
}
.ambient-snow {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.ambient-mesh {
  position: absolute;
  inset: -35%;
  opacity: 0.5;
  filter: blur(90px);
  will-change: transform;
  transform: translate3d(0, 0, 0);
  background:
    conic-gradient(from 200deg at 35% 45%, rgba(168, 85, 247, 0.32), transparent 32%, rgba(99, 102, 241, 0.24), transparent 58%, rgba(236, 72, 153, 0.18), transparent 82%, rgba(168, 85, 247, 0.28));
  animation: ambient-mesh-spin 70s linear infinite;
}
@keyframes ambient-mesh-spin {
  to { transform: rotate(360deg) scale(1.05); }
}
.ambient-flake {
  position: absolute;
  top: -12px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(216, 180, 254, 0.55) 35%, transparent 72%);
  box-shadow: 0 0 14px rgba(192, 132, 252, 0.75), 0 0 28px rgba(168, 85, 247, 0.25);
  animation: ambient-fall linear infinite;
  filter: blur(0.2px);
}
.ambient-flake:nth-child(1)  { left: 6%;  width: 2px; height: 2px; animation-duration: 14s; animation-delay: 0s; }
.ambient-flake:nth-child(2)  { left: 14%; width: 4px; height: 4px; animation-duration: 18s; animation-delay: -3s; }
.ambient-flake:nth-child(3)  { left: 22%; width: 2px; height: 2px; animation-duration: 12s; animation-delay: -7s; }
.ambient-flake:nth-child(4)  { left: 31%; width: 3px; height: 3px; animation-duration: 16s; animation-delay: -2s; }
.ambient-flake:nth-child(5)  { left: 40%; width: 3px; height: 3px; animation-duration: 20s; animation-delay: -9s; }
.ambient-flake:nth-child(6)  { left: 52%; width: 4px; height: 4px; animation-duration: 13s; animation-delay: -5s; }
.ambient-flake:nth-child(7)  { left: 61%; width: 2px; height: 2px; animation-duration: 17s; animation-delay: -1s; }
.ambient-flake:nth-child(8)  { left: 70%; width: 3px; height: 3px; animation-duration: 15s; animation-delay: -6s; }
.ambient-flake:nth-child(9)  { left: 78%; width: 3px; height: 3px; animation-duration: 19s; animation-delay: -4s; }
.ambient-flake:nth-child(10) { left: 86%; width: 4px; height: 4px; animation-duration: 11s; animation-delay: -8s; }
.ambient-flake:nth-child(11) { left: 93%; width: 2px; height: 2px; animation-duration: 16s; animation-delay: -10s; }
.ambient-flake:nth-child(12) { left: 48%; width: 5px; height: 5px; animation-duration: 22s; animation-delay: -12s; }
@keyframes ambient-fall {
  0%   { transform: translateY(-12px) translateX(0); opacity: 0; }
  8%   { opacity: 0.9; }
  92%  { opacity: 0.7; }
  100% { transform: translateY(100vh) translateX(24px); opacity: 0; }
}
.ambient-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 95% 88% at 50% 48%, transparent 55%, rgba(3, 3, 8, 0.28) 100%);
}
@keyframes ambient-aurora-drift {
  0% { transform: translate3d(-4%, -3%, 0) scale(1) rotate(0deg); }
  50% { transform: translate3d(2%, 1%, 0) scale(1.04) rotate(1deg); }
  100% { transform: translate3d(4%, 3%, 0) scale(1.07) rotate(0deg); }
}
@keyframes ambient-grid-pulse {
  0%, 100% { opacity: 0.38; }
  50% { opacity: 0.58; }
}
@keyframes ambient-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 44px 44px, 44px 44px; }
}
.site-nav,
.wrap {
  position: relative;
  z-index: 2;
}
@media (prefers-reduced-motion: reduce) {
  .ambient-aurora,
  .ambient-mesh,
  .ambient-grid,
  .ambient-flake { animation: none !important; }
  .ambient-canvas { display: none; }
  .ambient-flake { display: none; }
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  min-width: 0;
  overflow-x: clip;
}

/* Nav — clean open bar, no nested box */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 16px;
  min-width: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-bottom: 1px solid rgba(168, 85, 247, 0.14);
}
@media (max-width: 640px) {
  .site-nav { flex-wrap: wrap; padding: 16px 16px 12px; }
  .site-nav-brand { flex-wrap: wrap; gap: 10px; }
  .site-nav-tag {
    padding-left: 0;
    border-left: none;
    width: 100%;
    font-size: 0.76rem;
  }
  .nav-right { width: 100%; justify-content: flex-end; }
  .header-stats { justify-content: flex-start !important; }
  .app-tab { padding: 10px 8px; font-size: 0.82rem; }
  .app-tab-num { display: none; }
  .copy-main-row { flex-direction: column; }
  .btn-copy-main { min-width: 0; width: 100%; }
}
.site-nav-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.site-nav-tag {
  font-size: 0.8rem;
  color: #a78bfa;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding-left: 16px;
  border-left: 1px solid rgba(168, 85, 247, 0.22);
  line-height: 1.35;
}
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-shrink: 1;
}
#nav-status {
  max-width: min(300px, 52vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-progress-wrap {
  width: 88px;
}
.nav-progress-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.nav-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.35s ease;
}

/* Header minimal */
.app-header {
  margin-bottom: 12px;
}
.app-header-min {
  padding: 0;
}
.header-stats {
  justify-content: flex-end;
  width: 100%;
}
.app-title { display: none; }

/* Stats chips */
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.14);
  font-size: 0.78rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  max-width: 100%;
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.chip:hover {
  border-color: rgba(168, 85, 247, 0.28);
  transform: translateY(-1px);
}
.chip-accent {
  border-color: rgba(192, 38, 211, 0.42);
  background: linear-gradient(135deg, rgba(192, 38, 211, 0.18), rgba(168, 85, 247, 0.08));
  color: #f0abfc;
  box-shadow: 0 0 20px rgba(192, 38, 211, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
.chip-user {
  border-color: rgba(52, 211, 153, 0.38);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.14), rgba(16, 185, 129, 0.06));
  color: #6ee7b7;
  flex-wrap: wrap;
  max-width: min(100%, 380px);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
.chip b { color: var(--text); font-size: 0.9rem; font-weight: 700; }
.chip-user b,
#user-email {
  display: inline-block;
  max-width: min(160px, 38vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.btn-logout {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: inherit;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
}
.btn-logout:hover { opacity: 1; border-color: rgba(255, 255, 255, 0.25); }
.btn-logout-exit:hover {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}
.chip-user .btn-logout + .btn-logout {
  margin-left: 2px;
}

/* Legacy workflow bar — hidden */
.workflow-steps { display: none !important; }

/* Tabs */
.app-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 16px;
  border-radius: calc(var(--radius) + 4px);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.app-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.app-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.app-tab.active {
  color: var(--text);
  background: linear-gradient(135deg, rgba(192, 38, 211, 0.2), rgba(168, 85, 247, 0.1));
  box-shadow:
    0 2px 16px rgba(192, 38, 211, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  position: relative;
}
.app-tab.active::after {
  content: '';
  position: absolute;
  left: 16%;
  right: 16%;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #e879f9, transparent);
  opacity: 0.85;
}
.app-tab-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
}
.app-tab.active .app-tab-num {
  background: var(--accent);
  color: #fff;
}
.tab-panel { animation: tab-in 0.25s ease; min-width: 0; }
.tab-panel[hidden] { display: none !important; }
.tab-panel > .panel { margin-bottom: 0; }
.panel-compact { padding: 18px; }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Panels */
.panel {
  border: 1px solid var(--glass-border);
  background: linear-gradient(165deg, rgba(18, 18, 28, 0.82), rgba(10, 10, 18, 0.78));
  backdrop-filter: blur(20px) saturate(1.35);
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow:
    var(--shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  min-width: 0;
  overflow: hidden;
}
.section-title {
  color: #e879f9;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}
.preview-head .preview-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-transform: none;
  color: var(--text);
}
.section-desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.compact-hint { font-size: 0.76rem; color: var(--muted); line-height: 1.55; }

/* Dropzone */
.dropzone {
  border: 1.5px dashed rgba(168, 85, 247, 0.22);
  padding: 36px 20px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(168, 85, 247, 0.02));
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.dropzone:hover, .dropzone.dragover {
  border-color: rgba(192, 38, 211, 0.5);
  background: rgba(192, 38, 211, 0.06);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}
.dropzone-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid rgba(192, 38, 211, 0.2);
  position: relative;
}
.dropzone-icon::before {
  content: '';
  position: absolute;
  inset: 10px 12px;
  border: 2px solid #e879f9;
  border-radius: 3px;
  opacity: 0.7;
}
.dropzone-icon::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  height: 2px;
  background: #e879f9;
  opacity: 0.5;
  box-shadow: 0 5px 0 #e879f9, 0 10px 0 #e879f9;
  opacity: 0.35;
}
.dropzone-title { font-weight: 600; font-size: 0.95rem; color: var(--text); }

/* Upload queue */
.queue-box {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.18);
  margin-bottom: 14px;
  overflow: hidden;
  min-width: 0;
}
.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.queue-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: #c084fc;
}
.queue-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 180px;
  overflow-y: auto;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
  font-size: 0.82rem;
}
.queue-item:last-child { border-bottom: 0; }
.queue-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.queue-empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Buttons — unified hierarchy */
button {
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  cursor: pointer;
  transition: filter var(--transition), transform var(--transition), background var(--transition);
}
button:hover:not(:disabled) { filter: brightness(1.05); }
button:active:not(:disabled) { transform: translateY(0); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.btn-lg {
  padding: 12px 18px;
  font-size: 0.92rem;
  font-weight: 700;
}
.btn-primary {
  background: linear-gradient(165deg, #e879f9 0%, #c026d3 42%, #9333ea 100%);
  border: 1px solid rgba(232, 121, 249, 0.45);
  color: #fff;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 4px 18px rgba(192, 38, 211, 0.32);
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 28px rgba(192, 38, 211, 0.38);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  filter: brightness(0.98);
}
.btn-secondary {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(168, 85, 247, 0.22);
  color: var(--text);
  font-weight: 600;
  padding: 9px 14px;
  font-size: 0.86rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.btn-secondary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(168, 85, 247, 0.08));
  border-color: rgba(192, 38, 211, 0.35);
  transform: translateY(-1px);
}
.btn-danger-soft {
  background: var(--danger-soft);
  border: 1px solid rgba(248, 113, 113, 0.25);
  color: #fca5a5;
  font-weight: 600;
  padding: 8px 14px;
  font-size: 0.82rem;
}
.btn-danger-soft:hover:not(:disabled) { background: rgba(248, 113, 113, 0.18); }
.btn-ghost {
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  padding: 8px 12px;
  font-size: 0.84rem;
  font-weight: 600;
}
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,0.04); }
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
  min-width: 28px;
  min-height: 28px;
  font-size: 1.1rem;
  line-height: 1;
}
.queue-item .btn-icon {
  border-radius: 7px;
  border: 1px solid rgba(248, 113, 113, 0.22);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.06);
}
.queue-item .btn-icon:hover:not(:disabled) {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.38);
}
.btn-group-primary { margin-top: 4px; }

/* Status strip */
.status-strip {
  margin-top: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
  overflow: hidden;
  min-width: 0;
}
.status-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 14px;
  min-width: 0;
}
.status-row + .status-row {
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}
.status-kicker {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c084fc;
  padding-top: 2px;
}
.status-text {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.status-ellipsis {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: var(--text);
  font-weight: 500;
}
.status-meta {
  display: block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--muted);
  opacity: 0.9;
}
.status-strip-item {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
  min-width: 0;
  overflow-wrap: anywhere;
}
.status-strip-item b { color: var(--text); font-weight: 600; }

/* Settings / details — supreme accordion */
details.settings {
  margin-top: 12px;
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(6, 6, 14, 0.55));
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
details.settings summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #e9d5ff;
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.02em;
  user-select: none;
}
details.settings summary::-webkit-details-marker { display: none; }
details.settings summary::after {
  content: '';
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid #c084fc;
  border-bottom: 2px solid #c084fc;
  transform: rotate(45deg);
  transition: transform var(--transition);
  opacity: 0.9;
}
details.settings[open] summary::after {
  transform: rotate(-135deg);
}
details.settings[open] {
  border-color: rgba(192, 38, 211, 0.38);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
details.settings[open] summary {
  color: #f5d0fe;
  border-bottom: 1px solid rgba(168, 85, 247, 0.18);
  background: linear-gradient(90deg, rgba(192, 38, 211, 0.12), transparent);
}
details.settings .settings-body {
  padding: 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.22));
}
.settings-actions {
  margin-top: 4px;
  gap: 10px;
}
.settings-actions .btn-secondary {
  background: linear-gradient(165deg, #e879f9 0%, #c026d3 50%, #9333ea 100%);
  border: 1px solid rgba(232, 121, 249, 0.45);
  color: #fff;
  font-weight: 700;
  padding: 10px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 4px 16px rgba(192, 38, 211, 0.28);
}
.settings-actions .btn-secondary:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.settings-actions .btn-ghost {
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #d8b4fe;
  font-weight: 600;
  padding: 10px 16px;
}
.settings-actions .btn-ghost:hover:not(:disabled) {
  background: rgba(168, 85, 247, 0.12);
  color: #f5d0fe;
}
details.settings-danger {
  border-color: rgba(248, 113, 113, 0.28);
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.08), rgba(20, 8, 8, 0.5));
}
details.settings-danger summary { color: #fca5a5; }
details.settings-danger[open] summary {
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.1), transparent);
}
.summary-hint {
  font-weight: 400;
  font-size: 0.76rem;
  color: var(--muted);
  margin-left: 4px;
}

/* Copy mode — flat, no box-in-box */
.copy-mode {
  border: none;
  border-radius: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  margin-bottom: 18px;
  min-width: 0;
}
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px 16px;
  align-items: end;
  margin-bottom: 18px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
@media (max-width: 768px) {
  .filter-bar { grid-template-columns: 1fr 1fr; }
}
.filter-bar .field label,
.field label,
.anchor-grid .field label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c084fc;
  margin-bottom: 6px;
  display: block;
}
.filter-bar select { width: 100%; }
.btn-reset-queue {
  align-self: end;
  white-space: nowrap;
  border: 1px solid rgba(168, 85, 247, 0.25) !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(168, 85, 247, 0.06)) !important;
  color: #e9d5ff !important;
  font-weight: 600;
  padding: 10px 14px !important;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.btn-reset-queue:hover:not(:disabled) {
  border-color: rgba(232, 121, 249, 0.4) !important;
  background: rgba(168, 85, 247, 0.14) !important;
}

.next-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(192, 38, 211, 0.18);
  background: linear-gradient(135deg, rgba(192, 38, 211, 0.08), rgba(168, 85, 247, 0.04));
  font-size: 0.84rem;
  line-height: 1.5;
  color: #e9d5ff;
  margin-bottom: 12px;
  min-width: 0;
  overflow: hidden;
  word-break: break-word;
}
.next-card strong { color: #f5d0fe; }

.btn-copy-main {
  flex: 1;
  min-width: 180px;
  padding: 15px 20px;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  color: #fff;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.btn-copy-main::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.18) 50%, transparent 62%);
  transform: translateX(-120%);
  transition: transform 0.55s ease;
  pointer-events: none;
}
.btn-copy-main:hover:not(:disabled)::before {
  transform: translateX(120%);
}
.btn-copy-main:hover:not(:disabled) {
  filter: brightness(1.06);
  transform: translateY(-2px);
}
.btn-copy-main:active:not(:disabled) { transform: translateY(0); }
.btn-copy-html {
  background: linear-gradient(165deg, #a5b4fc 0%, #6366f1 48%, #4f46e5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 20px rgba(99, 102, 241, 0.3);
}
.btn-copy-html:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 28px rgba(99, 102, 241, 0.38);
}
.btn-copy-visual {
  background: linear-gradient(165deg, #f0abfc 0%, #c026d3 48%, #9333ea 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 20px rgba(192, 38, 211, 0.3);
}
.btn-copy-visual:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 28px rgba(192, 38, 211, 0.38);
}

.copy-feedback {
  min-height: 0;
  margin-top: 10px;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  display: none;
  transition: padding var(--transition);
}
.copy-feedback.show {
  display: block;
  padding: 10px 14px;
}
.copy-feedback.status-success { background: var(--success-soft); border: 1px solid rgba(52,211,153,.25); color: #6ee7b7; }
.copy-feedback.status-error { background: var(--danger-soft); border: 1px solid rgba(248,113,113,.25); color: #fca5a5; }
.copy-feedback.status-warn { background: var(--warn-soft); border: 1px solid rgba(251,191,36,.25); color: #fcd34d; }
.copy-feedback.status-info { background: var(--accent-soft); border: 1px solid rgba(192,38,211,.25); color: #e9d5ff; }

.link-preview {
  font-size: 0.76rem;
  color: #a78bfa;
  margin-bottom: 10px;
  line-height: 1.5;
}

/* Category chips */
.cat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cat-chip {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.16);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all var(--transition);
}
.cat-chip:hover:not(:disabled) {
  color: #fff;
  border-color: rgba(192, 38, 211, 0.45);
  background: linear-gradient(135deg, rgba(192, 38, 211, 0.22), rgba(168, 85, 247, 0.1));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(192, 38, 211, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.cat-chip-brand {
  border-color: rgba(124, 58, 237, 0.4);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.04));
}
.cat-chip-umum {
  border-color: rgba(37, 99, 235, 0.4);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.04));
}
.cat-chip-turunan {
  border-color: rgba(5, 150, 105, 0.4);
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.12), rgba(5, 150, 105, 0.04));
}
.cat-chip-campuran {
  border-color: rgba(234, 88, 12, 0.4);
  background: linear-gradient(135deg, rgba(234, 88, 12, 0.12), rgba(234, 88, 12, 0.04));
}
.cat-chip-mixed {
  border-color: rgba(168, 85, 247, 0.4);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.14), rgba(236, 72, 153, 0.06));
}

.anchor-detected {
  font-size: 0.8rem;
  color: #d8b4fe;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(99, 102, 241, 0.05));
  border: 1px solid rgba(168, 85, 247, 0.22);
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.anchor-detected code {
  background: rgba(192, 38, 211, 0.1);
  color: #e879f9;
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-all;
}
.anchor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.anchor-grid .field input { width: 100%; }

.field label {
  display: block;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
}
@media (max-width: 700px) {
  .field-grid { grid-template-columns: 1fr; }
}
.field-grid-actions { align-self: end; }
.field-input-narrow { min-width: 0; width: 100%; max-width: 220px; }
.filter-grid {
  display: grid;
  grid-template-columns: 1.2fr repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.filter-grid .field { min-width: 0; }
.filter-grid select,
.filter-grid input { width: 100%; }
.grow { flex: 1; min-width: 0; }

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.muted { color: var(--muted); font-size: 0.82rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-brand { background: rgba(124,58,237,.2); color: #c4b5fd; }
.badge-umum { background: rgba(37,99,235,.2); color: #93c5fd; }
.badge-turunan { background: rgba(5,150,105,.2); color: #6ee7b7; }
.badge-campuran { background: rgba(234,88,12,.2); color: #fdba74; }
.badge-mixed { background: rgba(168,85,247,.2); color: #d8b4fe; }
.badge-lain { background: rgba(100,116,139,.2); color: #cbd5e1; }
.badge-theme { background: rgba(14,165,233,.15); color: #7dd3fc; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -2px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast — Ava-inspired, dark premium */
.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100002;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, calc(100vw - 32px));
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  border-radius: var(--radius-sm);
  background: rgba(14, 14, 22, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  animation: toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.toast-item.toast-out {
  animation: toast-out 0.28s ease forwards;
}
@keyframes toast-in {
  0% { opacity: 0; transform: translateX(18px) scale(0.9); }
  55% { transform: translateX(-3px) scale(1.02); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(14px) scale(0.95); }
}
.toast-row {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  min-height: 64px;
}
.toast-icon-col {
  flex-shrink: 0;
  width: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: inset 0 -4px 12px rgba(0, 0, 0, 0.22);
}
.toast-ava-svg {
  width: 26px;
  height: 26px;
  display: block;
}
.toast-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.toast-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 10px 8px 12px;
  flex: 1;
}
.toast-content { flex: 1; min-width: 0; }
.toast-label {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 3px;
}
.toast-message {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.toast-close-svg {
  width: 13px;
  height: 13px;
  display: block;
}
.toast-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.toast-progress-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.toast-progress-bar {
  height: 100%;
  width: 0;
  animation: toast-progress-grow linear forwards;
}
@keyframes toast-progress-grow {
  from { width: 0%; }
  to { width: 100%; }
}
.toast-item.status-success { border-color: rgba(52, 211, 153, 0.35); }
.toast-item.status-success .toast-icon-col { background: linear-gradient(180deg, #2d8a62 0%, #1a5c40 100%); }
.toast-item.status-success .toast-progress-bar { background: var(--success); }
.toast-item.status-error { border-color: rgba(248, 113, 113, 0.35); }
.toast-item.status-error .toast-icon-col { background: linear-gradient(180deg, #a84848 0%, #7a2e2e 100%); }
.toast-item.status-error .toast-progress-bar { background: var(--danger); }
.toast-item.status-warn { border-color: rgba(251, 191, 36, 0.35); }
.toast-item.status-warn .toast-icon-col { background: linear-gradient(180deg, #c48820 0%, #8a5a12 100%); }
.toast-item.status-warn .toast-progress-bar { background: var(--warn); }
.toast-item.status-info { border-color: rgba(168, 85, 247, 0.35); }
.toast-item.status-info .toast-icon-col { background: linear-gradient(180deg, #5b4db8 0%, #3d3a8c 100%); }
.toast-item.status-info .toast-progress-bar { background: var(--accent-2); }

.section-notice {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.section-notice.show { display: block; }
.section-notice.status-success { background: var(--success-soft); border: 1px solid rgba(52,211,153,.28); color: #6ee7b7; }
.section-notice.status-error { background: var(--danger-soft); border: 1px solid rgba(248,113,113,.28); color: #fca5a5; }
.section-notice.status-warn { background: var(--warn-soft); border: 1px solid rgba(251,191,36,.28); color: #fcd34d; }
.section-notice.status-info { background: var(--accent-soft); border: 1px solid rgba(192,38,211,.28); color: #e9d5ff; }

/* Section notices — persistent */
.section-notice-persist {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.section-notice-persist:not(.show) { display: none; }

/* Cards preview */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 14px;
  min-width: 0;
}
.card {
  border: 1px solid rgba(168, 85, 247, 0.12);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015));
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.card:hover {
  border-color: rgba(192, 38, 211, 0.32);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28), var(--shadow-glow);
  transform: translateY(-2px);
}
.card .title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.card .muted {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.btn-card {
  padding: 6px 12px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
}
.btn-card-html:hover { border-color: rgba(99,102,241,.5); background: rgba(99,102,241,.1); }
.btn-card-visual:hover { border-color: rgba(192,38,211,.5); background: var(--accent-soft); }
.card-ok {
  font-size: 0.76rem;
  color: var(--success);
  min-height: 16px;
}

/* Empty state */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 1.5px dashed var(--line2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}
.empty-state-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  color: rgba(192, 38, 211, 0.45);
}
.empty-state-title {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.empty-state-desc {
  margin: 0;
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 360px;
  margin-inline: auto;
}

/* Inputs — custom dark selects + premium fields */
input, select, button { color: var(--text); font-family: inherit; }

:root {
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23c084fc' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

.field input:not([type="checkbox"]):not([type="radio"]),
.field select,
.filter-bar select,
.filter-grid input,
.filter-grid select,
.anchor-grid input,
.anchor-grid select,
.grow {
  width: 100%;
  border: 1px solid rgba(168, 85, 247, 0.22);
  background-color: rgba(6, 6, 14, 0.88);
  background-image: none;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 11px 14px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}
.field select,
.filter-bar select,
.filter-grid select,
.anchor-grid select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 38px;
  cursor: pointer;
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
}
.field select option,
.filter-bar select option,
.filter-grid select option {
  background: #12121e;
  color: #f0f0f5;
}
.field input:not([type="checkbox"]):not([type="radio"]):hover,
.field select:hover,
.filter-bar select:hover,
.filter-grid input:hover,
.filter-grid select:hover,
.anchor-grid input:hover {
  border-color: rgba(192, 38, 211, 0.35);
  background-color: rgba(10, 10, 18, 0.95);
}
.field input:not([type="checkbox"]):not([type="radio"]):focus,
.field select:focus,
.filter-bar select:focus,
.filter-grid input:focus,
.filter-grid select:focus,
.anchor-grid input:focus,
.grow:focus {
  outline: none;
  border-color: rgba(232, 121, 249, 0.55);
  background-color: rgba(12, 10, 22, 0.98);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.18), inset 0 1px 3px rgba(0, 0, 0, 0.3);
}
.field input::placeholder,
.anchor-grid input::placeholder {
  color: rgba(156, 163, 175, 0.65);
  font-weight: 400;
}
.tutorial-dismiss input { width: auto; padding: 0; border: none; background: transparent; }

/* Loader overlay + scene */
#session-loader-app {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 35%, rgba(168, 85, 247, 0.16), transparent 42%),
    radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.1), transparent 35%),
    rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
#session-loader-app.loader-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
#session-loader-app[hidden] { display: none !important; }
.loader-scene {
  width: min(420px, 100%);
  text-align: center;
  position: relative;
}
.loader-glow {
  position: absolute;
  left: 50%;
  top: 28px;
  width: 160px;
  height: 160px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.22), transparent 68%);
  filter: blur(8px);
  pointer-events: none;
}
.loader-orbit {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 20px;
  display: grid;
  place-items: center;
}
.loader-orbit-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #ec4899;
  border-right-color: rgba(168, 85, 247, 0.45);
  animation: orbit-spin 1.1s linear infinite;
}
.loader-icon {
  width: 56px;
  height: 56px;
  object-fit: contain;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 14px rgba(236, 72, 153, 0.45));
  animation: icon-float 2.4s ease-in-out infinite;
}
@keyframes icon-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.loader-logo-img {
  max-width: min(240px, 78vw);
  height: auto;
  margin: 0 auto 18px;
  display: block;
  object-fit: contain;
}
.brand-logo-img {
  max-height: 44px;
  width: auto;
  display: block;
}
.loader-quote {
  margin: 0 0 8px;
  font-size: 0.98rem;
  line-height: 1.6;
  font-weight: 600;
  color: var(--text);
}
.loader-tip {
  margin: 0 0 18px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.loader-track {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  max-width: 280px;
  margin: 0 auto;
}
.loader-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ec4899, #a855f7, #6366f1);
  transition: width 0.22s ease;
}
@keyframes orbit-spin { to { transform: rotate(360deg); } }

body.booting .wrap { opacity: 0.35; pointer-events: none; }
body.loading-overlay { cursor: wait; }
body.auth-switching .wrap,
body.auth-switching .site-nav { visibility: hidden; }
body.auth-switching #session-loader-app {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
body.auth-switching #session-loader-app[hidden] { display: flex !important; }

.brand-logo-img-lg {
  max-height: 54px;
  width: auto;
  filter: drop-shadow(0 2px 12px rgba(168, 85, 247, 0.35));
}
.panel-compact .section-desc { max-width: 520px; }
.panel-auth { display: none !important; }

/* Login modal */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-modal[hidden] { display: none !important; }
.login-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 2, 8, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}
.login-modal-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 34px 30px 28px;
  border-radius: 24px;
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: linear-gradient(168deg, rgba(24, 20, 38, 0.97), rgba(8, 8, 16, 0.98));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 60px rgba(168, 85, 247, 0.12);
  text-align: center;
  animation: supreme-modal-in 0.42s var(--ease-spring);
}
.login-modal-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(232, 121, 249, 0.45), rgba(99, 102, 241, 0.2), rgba(192, 38, 211, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.65;
}
@keyframes supreme-modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-modal-logo {
  max-width: 200px;
  height: auto;
  margin: 0 auto 18px;
  display: block;
}
.login-modal-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #e879f9;
  border: 1px solid rgba(192, 38, 211, 0.35);
  background: rgba(192, 38, 211, 0.1);
}
.login-modal-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.login-modal-lead {
  margin: 0 0 18px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}
.login-modal-reason {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.25);
  background: rgba(245, 158, 11, 0.08);
}
.login-modal-reason:empty,
.login-modal-reason[hidden] { display: none; }
.btn-google-official {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 13px 18px;
  border-radius: 12px;
  border: 1px solid #dadce0;
  background: #fff;
  color: #3c4043;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.btn-google-official:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  transform: translateY(-1px);
}
.btn-google-official:active { transform: translateY(0); }
.btn-google-official svg { flex-shrink: 0; }
.btn-google-label { line-height: 1.2; }
body.login-modal-open .wrap,
body.login-modal-open .site-nav {
  filter: blur(4px);
  pointer-events: none;
}
body.login-modal-open .login-modal { pointer-events: auto; }

.html-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.75);
}
.html-modal[hidden] { display: none !important; }

/* Hide legacy noisy elements */
.status-bar { display: none !important; }
.anchor-panel-title { display: none; }
.next-banner { display: none; }

/* Nav help button */
.btn-nav-help {
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(192, 38, 211, 0.35);
  background: rgba(192, 38, 211, 0.08);
  color: #e879f9;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.btn-nav-help:hover {
  background: rgba(192, 38, 211, 0.16);
  border-color: rgba(192, 38, 211, 0.5);
}
.btn-nav-help[hidden] { display: none !important; }

/* Tutorial modal */
.tutorial-modal {
  position: fixed;
  inset: 0;
  z-index: 100003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tutorial-modal[hidden] { display: none !important; }
.tutorial-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tutorial-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 820px);
  overflow: auto;
  padding: 28px 26px 24px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(165deg, rgba(18, 18, 28, 0.98), rgba(8, 8, 14, 0.98));
  box-shadow:
    0 0 0 1px rgba(192, 38, 211, 0.12),
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 80px rgba(192, 38, 211, 0.08);
  animation: tutorial-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes tutorial-in {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tutorial-close-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.tutorial-close-x:hover { background: rgba(255,255,255,0.12); color: var(--text); }
.tutorial-header { margin-bottom: 20px; padding-right: 28px; }
.tutorial-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e879f9;
  border: 1px solid rgba(192, 38, 211, 0.35);
  background: rgba(192, 38, 211, 0.1);
}
.tutorial-header h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--text);
}
.tutorial-lead {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--muted);
}
.tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.tutorial-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color var(--transition);
}
.tutorial-step:hover { border-color: rgba(192, 38, 211, 0.25); }
.tutorial-step-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 12px rgba(192, 38, 211, 0.3);
}
.tutorial-step-body h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.tutorial-step-body p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}
.tutorial-step-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(192, 38, 211, 0.12);
  color: #e879f9;
  font-size: 0.85em;
}
.tutorial-step-body strong { color: #e9d5ff; font-weight: 600; }
.tutorial-tips {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.06);
  font-size: 0.78rem;
  line-height: 1.55;
  color: #fcd34d;
}
.tutorial-tips p { margin: 0; }
.tutorial-tips strong { color: #fde68a; }
.tutorial-dismiss {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.tutorial-dismiss input { width: auto; margin: 0; accent-color: var(--accent); }
.tutorial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tutorial-actions .btn-primary { flex: 1; min-width: 160px; }
body.tutorial-open { overflow: hidden; }
body.tutorial-open .wrap,
body.tutorial-open .site-nav {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
}
body.tutorial-open .tutorial-modal { pointer-events: auto; }

/* === Supreme v12 polish layer === */
.copy-main-row { display: flex; gap: 10px; flex-wrap: wrap; }

.app-tabs {
  box-shadow:
    0 4px 24px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 var(--glass-highlight);
}

.panel {
  position: relative;
}
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 121, 249, 0.35), transparent);
  pointer-events: none;
}

.btn-primary {
  position: relative;
  overflow: hidden;
  background: var(--supreme-gradient);
  background-size: 200% auto;
}
.btn-primary:hover:not(:disabled) {
  background-position: right center;
}

.btn-nav-help {
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.12), rgba(168, 85, 247, 0.04));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: all var(--transition);
}
.btn-nav-help:hover {
  border-color: rgba(232, 121, 249, 0.45);
  box-shadow: 0 4px 16px rgba(192, 38, 211, 0.2);
  transform: translateY(-1px);
}

details.settings {
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.08), rgba(6, 6, 14, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
details.settings[open] {
  border-color: rgba(192, 38, 211, 0.38);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}
details.settings summary {
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #e9d5ff;
}

.next-card {
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: linear-gradient(135deg, rgba(192, 38, 211, 0.1), rgba(99, 102, 241, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.badge-brand, .badge-umum, .badge-turunan, .badge-campuran, .badge-mixed, .badge-lain, .badge-theme {
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  font-weight: 700;
  letter-spacing: 0.03em;
}

#session-loader-app {
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(168, 85, 247, 0.2), transparent 60%),
    rgba(3, 3, 8, 0.94);
  backdrop-filter: blur(12px);
}

.loader-glow {
  filter: blur(48px);
  opacity: 0.85;
}

.loader-orbit-ring {
  border-color: rgba(232, 121, 249, 0.55);
  box-shadow: 0 0 24px rgba(192, 38, 211, 0.35);
}

.loader-bar {
  background: var(--supreme-gradient);
  box-shadow: 0 0 12px rgba(192, 38, 211, 0.45);
}

.toast-item {
  border: 1px solid rgba(168, 85, 247, 0.18);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.status-strip {
  border-color: rgba(168, 85, 247, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tutorial-card {
  border: 1px solid rgba(168, 85, 247, 0.2);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.65),
    0 0 48px rgba(168, 85, 247, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.empty-state {
  border-color: rgba(168, 85, 247, 0.2);
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.04), rgba(0, 0, 0, 0.1));
}

/* Supreme custom select — no native Windows blue popup */
.supreme-select {
  position: relative;
  width: 100%;
  min-width: 0;
}
.supreme-select-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.supreme-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(14, 12, 24, 0.95), rgba(6, 6, 14, 0.92));
  color: #f5f3ff;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.2);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.supreme-select-trigger:hover {
  border-color: rgba(232, 121, 249, 0.45);
  background: linear-gradient(180deg, rgba(18, 14, 30, 0.98), rgba(8, 8, 16, 0.95));
}
.supreme-select.is-open .supreme-select-trigger,
.supreme-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(232, 121, 249, 0.58);
  box-shadow:
    0 0 0 3px rgba(192, 38, 211, 0.2),
    inset 0 1px 3px rgba(0, 0, 0, 0.35);
}
.supreme-select-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.supreme-select-chevron {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid #c084fc;
  border-bottom: 2px solid #c084fc;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--transition);
  opacity: 0.95;
}
.supreme-select.is-open .supreme-select-chevron {
  transform: rotate(-135deg) translateY(2px);
}
.supreme-select-menu {
  position: absolute;
  z-index: 120;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: min(280px, 42vh);
  overflow-y: auto;
  border: 1px solid rgba(168, 85, 247, 0.32);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(18, 14, 28, 0.98), rgba(8, 8, 16, 0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.55),
    0 0 24px rgba(168, 85, 247, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.4) transparent;
}
.supreme-select-option {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 500;
  color: #e9d5ff;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.supreme-select-option:hover {
  background: rgba(168, 85, 247, 0.18);
  color: #fdf4ff;
}
.supreme-select-option.is-selected {
  background: linear-gradient(90deg, rgba(192, 38, 211, 0.28), rgba(168, 85, 247, 0.12));
  color: #fdf4ff;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(232, 121, 249, 0.25);
}
.supreme-select-option.is-focused {
  background: rgba(168, 85, 247, 0.22);
  color: #fdf4ff;
  outline: 2px solid rgba(232, 121, 249, 0.35);
  outline-offset: -2px;
}

/* ─── Supreme tooltip (no native white box) ─── */
.supreme-tip {
  position: fixed;
  z-index: 200000;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.45;
  color: #f5d0fe;
  pointer-events: none;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: linear-gradient(165deg, rgba(22, 16, 36, 0.98), rgba(10, 8, 18, 0.98));
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.55),
    0 0 20px rgba(168, 85, 247, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  transform: translateY(4px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s var(--ease-spring);
}
.supreme-tip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ─── Tab + accordion motion ─── */
.tab-panel.tab-panel-enter {
  animation: tab-panel-in 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes tab-panel-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.app-tab {
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform 0.2s ease;
}
.app-tab:active:not(.active) {
  transform: scale(0.98);
}
.app-tab.active {
  animation: tab-pill-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes tab-pill-in {
  from { transform: scale(0.97); }
  to { transform: scale(1); }
}
details.settings[open] .settings-body {
  animation: accordion-in 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes accordion-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Preview cards — premium ─── */
.cards {
  gap: 16px;
}
.card {
  position: relative;
  overflow: hidden;
  gap: 8px;
  padding: 18px;
  border-color: rgba(168, 85, 247, 0.18);
  background: linear-gradient(165deg, rgba(168, 85, 247, 0.06), rgba(8, 8, 16, 0.55));
}
.card-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--supreme-gradient);
  opacity: 0.85;
}
.card-enter {
  animation: card-in 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: calc(var(--card-i, 0) * 48ms);
}
@keyframes card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}
.card-code {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a78bfa;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(168, 85, 247, 0.08);
}
.card-source {
  font-size: 0.76rem;
  color: #9ca3af;
  font-weight: 500;
}
.card-anchor {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}
.card-anchor b { color: #e9d5ff; }
.card .title {
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin: 2px 0 4px;
}
.btn-card {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.78rem;
  border-radius: 9px;
  transition: all var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.btn-card-html {
  border-color: rgba(99, 102, 241, 0.35);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.14), rgba(99, 102, 241, 0.06));
  color: #c7d2fe;
}
.btn-card-visual {
  border-color: rgba(192, 38, 211, 0.35);
  background: linear-gradient(180deg, rgba(192, 38, 211, 0.14), rgba(168, 85, 247, 0.06));
  color: #f5d0fe;
}
.btn-card:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}
.card-ok:not(:empty) {
  animation: card-ok-pop 0.4s cubic-bezier(0.34, 1.45, 0.64, 1);
  font-weight: 600;
}
@keyframes card-ok-pop {
  0% { opacity: 0; transform: translateY(4px); }
  60% { opacity: 1; transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

/* Empty state premium */
.empty-state {
  padding: 64px 28px;
  border: 1px dashed rgba(168, 85, 247, 0.28);
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(168, 85, 247, 0.08), transparent 70%),
    rgba(255, 255, 255, 0.02);
}
.empty-state-icon {
  color: rgba(192, 132, 252, 0.55);
  filter: drop-shadow(0 0 16px rgba(168, 85, 247, 0.25));
}

/* ─── Mobile supreme pass ─── */
@media (max-width: 640px) {
  .filter-bar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .btn-reset-queue {
    width: 100%;
    text-align: center;
  }
  .app-tabs {
    gap: 3px;
    padding: 4px;
  }
  .app-tab {
    padding: 10px 8px;
    font-size: 0.8rem;
    gap: 5px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .card-actions {
    flex-direction: column;
  }
  .btn-card {
    width: 100%;
  }
  .preview-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .filter-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .site-nav-brand {
    flex-direction: column;
    align-items: flex-start;
  }
  .brand-logo-img-lg {
    max-height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-panel.tab-panel-enter,
  .card-enter,
  details.settings[open] .settings-body,
  .app-tab.active,
  .card-ok:not(:empty),
  .supreme-tip,
  .copy-success-pulse {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── v17 Features: copy pulse, history, stats, PWA ─── */
.btn-copy-main.copy-success-pulse,
.btn-card.copy-success-pulse {
  animation: copy-success-pulse 0.55s cubic-bezier(0.34, 1.45, 0.64, 1);
}
@keyframes copy-success-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  45% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { transform: scale(1); }
}

.settings-io-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(168, 85, 247, 0.14);
}
.btn-sm { padding: 8px 12px; font-size: 0.8rem; }
.btn-file-import { cursor: pointer; display: inline-flex; align-items: center; }

.btn-stats-admin {
  border-color: rgba(52, 211, 153, 0.35) !important;
  color: #6ee7b7 !important;
}
.btn-stats-reset {
  border-color: rgba(248, 113, 113, 0.35) !important;
  color: #fca5a5 !important;
}
.btn-stats-reset:hover {
  background: rgba(248, 113, 113, 0.1) !important;
}
#btn-focus-mode.is-active {
  border-color: rgba(192, 132, 252, 0.55) !important;
  color: #f5d0fe !important;
  background: rgba(168, 85, 247, 0.14) !important;
}

body.focus-mode-on .app-header-min,
body.focus-mode-on .status-strip,
body.focus-mode-on .nav-progress-wrap,
body.focus-mode-on .site-nav-tag,
body.focus-mode-on details.settings {
  display: none !important;
}

.stats-audit-panel {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: rgba(8, 10, 28, 0.55);
}
.stats-audit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}
.stats-audit-item {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.12);
}
.stats-audit-time {
  font-size: 0.7rem;
  color: #a78bfa;
  font-weight: 600;
}
.stats-audit-action {
  font-size: 0.8rem;
  color: var(--text);
}
.stats-audit-actor {
  font-size: 0.72rem;
}

.stats-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.stats-admin-modal[hidden] { display: none !important; }
.stats-admin-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
}
.stats-admin-card {
  position: relative;
  width: min(920px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  border: 1px solid rgba(168, 85, 247, 0.28);
  border-radius: var(--radius);
  background: linear-gradient(165deg, rgba(18, 14, 28, 0.98), rgba(8, 8, 16, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  padding: 20px;
}
.stats-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.stats-admin-head h2 { margin: 0; font-size: 1.1rem; color: #f5d0fe; }
.stats-admin-tools { display: flex; align-items: center; gap: 8px; }
.stats-days-label { font-size: 0.76rem; color: var(--muted); }
.stats-days-select {
  border: 1px solid rgba(168, 85, 247, 0.28);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.stats-admin-note { margin: 0 0 14px; font-size: 0.76rem; color: #6ee7b7; }
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stats-kpi {
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(168, 85, 247, 0.18);
  background: rgba(168, 85, 247, 0.06);
}
.stats-kpi span { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }
.stats-kpi b { font-size: 1.25rem; color: #f5d0fe; }
.stats-cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.stats-chip {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(168, 85, 247, 0.2);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.76rem;
  color: #e9d5ff;
}
.stats-chip b { color: #f5d0fe; margin-left: 4px; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.stats-table th,
.stats-table td {
  border-bottom: 1px solid rgba(168, 85, 247, 0.12);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}
.stats-table th {
  color: #c084fc;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-access-panel {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.22);
  background: rgba(12, 8, 24, 0.55);
}
.stats-access-title {
  margin: 0 0 6px;
  font-size: 0.92rem;
  color: #f5d0fe;
}
.stats-access-hint {
  margin: 0 0 12px;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.45;
}
.stats-access-add {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.stats-access-input {
  flex: 1 1 180px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.82rem;
}
.stats-access-input:focus {
  outline: none;
  border-color: rgba(192, 132, 252, 0.55);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}
.stats-access-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.stats-access-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(168, 85, 247, 0.1);
}
.stats-access-super {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.06);
}
.stats-access-email {
  font-size: 0.8rem;
  word-break: break-all;
}
.stats-access-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6ee7b7;
  white-space: nowrap;
}
.stats-access-empty {
  padding: 6px 2px;
  font-size: 0.76rem;
}

@media (max-width: 640px) {
  .stats-summary { grid-template-columns: 1fr; }
  .settings-io-row { flex-direction: column; }
  .settings-io-row .btn-sm { width: 100%; justify-content: center; }
}
