/* ===== Toast Notifications ===== */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.lsp-toast {
  position: fixed;
  right: 32px;
  bottom: 90px;
  z-index: 100001;
  min-width: 260px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #f9fafb;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}

.lsp-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lsp-toast .lsp-toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lsp-toast .lsp-toast-icon svg {
  width: 13px;
  height: 13px;
  stroke: #022c22;
}

/* Toast variants */
.lsp-toast-warning,
.lsp-toast.warning {
  border-color: #f59e0b;
}
.lsp-toast-warning .lsp-toast-icon,
.lsp-toast.warning .lsp-toast-icon {
  background: radial-gradient(circle at 30% 20%, #fef3c7, #f59e0b);
}
.lsp-toast-warning .lsp-toast-icon svg,
.lsp-toast.warning .lsp-toast-icon svg {
  stroke: #78350f;
}

.lsp-toast-error,
.lsp-toast.error {
  border-color: #ef4444;
}
.lsp-toast-error .lsp-toast-icon,
.lsp-toast.error .lsp-toast-icon {
  background: radial-gradient(circle at 30% 20%, #fecaca, #ef4444);
}
.lsp-toast-error .lsp-toast-icon svg,
.lsp-toast.error .lsp-toast-icon svg {
  stroke: #7f1d1d;
}

.lsp-toast-success .lsp-toast-icon svg {
  stroke: #10b981;
}

/* ===== Sync Choice Modal ===== */
.lsp-sync-option:hover {
  border-color: #93c5fd !important;
  background: #f8fafc !important;
}

/* ===== Progress Component ===== */
.wrap.lightsyncpro {
  --lsp-accent: #ff5757;
  --lsp-accent-2: #ff7a7a;
  --lsp-track: #e5e7eb;
  --lsp-ring-gap: 7px;
  overflow: visible;
}

/* Base progress container - centered in panel */
#lsp-progress {
  max-width: 420px;
  margin: 0 auto;
}

#lsp-progress.lsp-progress.is-circle {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 0;
}

/* Cancel button for background sync - in command bar */
#lsp-cancel-background {
  color: #dc2626;
  border-color: #fecaca;
  background: #fff;
}

#lsp-cancel-background:hover {
  background: #fef2f2;
  border-color: #f87171;
}

#lsp-cancel-background .dashicons {
  font-size: 16px;
  width: 16px;
  height: 16px;
  line-height: 16px;
}

/* Progress ring */
/* Progress ring */
#lsp-progress .lsp-ring,
.wrap.lightsyncpro .lsp-ring {
  --size: 88px;
  --p: 0;
  width: var(--size);
  height: var(--size);
  min-width: var(--size);
  min-height: var(--size);
  aspect-ratio: 1 / 1;
  flex: 0 0 var(--size);
  border-radius: 50%;
  position: relative;
  box-sizing: border-box;

  /* gradient-filled progress arc */
  background:
    conic-gradient(#0000 calc(var(--p)*1%), var(--lsp-track) 0),
    linear-gradient(135deg, var(--lsp-primary, #ff5757), var(--lsp-primary-600, #2563eb));

  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(50% - var(--lsp-ring-gap)),
    #000 calc(50% - var(--lsp-ring-gap) + 1px)
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(50% - var(--lsp-ring-gap)),
    #000 calc(50% - var(--lsp-ring-gap) + 1px)
  );

  animation: lsp-spin 1s linear infinite paused;
}


.wrap.lightsyncpro .lsp-ring.indeterminate {
  animation-play-state: running;
  background: conic-gradient(var(--lsp-accent) 25%, var(--lsp-track) 0);
}

/* Center content - horizontal layout for background sync */
#lsp-progress .lsp-center {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-align: left;
}

/* Percentage display */
#lsp-progress .lsp-percent {
  font-size: 28px;
  font-weight: 700;
  color: var(--lsp-text, #0f172a);
  line-height: 1;
  min-width: 65px;
  flex-shrink: 0;
}

/* Sub text (album info) */
#lsp-progress .lsp-sub {
  font-size: 13px;
  color: var(--lsp-subtext, #64748b);
  line-height: 1.4;
  text-align: left;
  opacity: 1;
  animation: none;
}

#lsp-progress .lsp-sub strong {
  color: var(--lsp-text, #0f172a);
  display: block;
  margin-bottom: 2px;
}

/* Indeterminate spinner icon */
#lsp-progress .lsp-indeterminate {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

#lsp-progress .lsp-indeterminate img,
#lsp-progress .lsp-indeterminate svg {
  display: block;
  width: 36px;
  height: 36px;
  animation: lsp-pulse 2s ease-in-out infinite;
}

/* Indeterminate mode */
#lsp-progress.is-indeterminate .lsp-percent {
  display: none;
}

#lsp-progress.is-indeterminate .lsp-indeterminate {
  display: flex;
}

/* Log area */
#lsp-progress .lsp-log,
#lsp-log {
  max-height: 100px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.5;
  text-align: left;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
}

#lsp-log:empty {
  display: none;
}

#lsp-log div {
  padding: 2px 0;
  opacity: 0.6;
}

#lsp-log div:last-child {
  opacity: 1;
  font-weight: 500;
}

.wrap.lightsyncpro .lsp-log {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  background: rgba(0,0,0,0.03);
  border: none;
  border-radius: 8px;
  padding: 10px;
}

/* ===== Modal Progress Layout ===== */
.lsp-modal #lsp-progress.lsp-progress.is-circle {
  display: grid;
  grid-template-columns: var(--size, 88px) 1fr;
  grid-template-areas:
    "ring center"
    "log  log";
  gap: 14px 16px;
  align-items: center;
  max-width: 100%;
}

.lsp-modal #lsp-progress .lsp-ring {
  grid-area: ring;
}

.lsp-modal #lsp-progress .lsp-center {
  grid-area: center;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.lsp-modal #lsp-progress #lsp-log {
  grid-area: log;
  margin-top: 6px;
  max-height: 220px;
}

.lsp-modal #lsp-progress .lsp-sub {
  margin-top: 4px;
  max-width: 52ch;
  line-height: 1.35;
  white-space: normal;
}

.lsp-modal .lsp-ring {
  --size: 88px;
  --p: 0;
  width: var(--size);
  height: var(--size);
  min-width: var(--size);
  min-height: var(--size);
  aspect-ratio: 1 / 1;
  flex: 0 0 var(--size);
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--lsp-primary, #ff5757) calc(var(--p)*1%), var(--lsp-track, #e5e7eb) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(50% - var(--lsp-ring-gap, 7px)), #000 calc(50% - var(--lsp-ring-gap, 7px) + 1px));
  mask: radial-gradient(farthest-side, transparent calc(50% - var(--lsp-ring-gap, 7px)), #000 calc(50% - var(--lsp-ring-gap, 7px) + 1px));
}

.lsp-modal .lsp-center {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.lsp-modal .lsp-percent {
  font-weight: 900;
  font-size: 18px;
  line-height: 1;
  color: var(--lsp-text, #0f172a);
}

.lsp-modal .lsp-indeterminate {
  opacity: .85;
}

.lsp-modal .lsp-log {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  padding: 10px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  border: none;
  font-size: 12px;
}

.lsp-modal {
  transform: translateZ(0);
}

/* ===== Animations ===== */
@keyframes lsp-pulse {
  0%, 100% { 
    opacity: 0.6; 
    transform: scale(0.95);
  }
  50% { 
    opacity: 1; 
    transform: scale(1.05);
  }
}

@keyframes lsp-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes lsp-fade-in {
  to {
    opacity: 1;
  }
}

@keyframes lspFlash {
  0% {
    background: rgba(34, 197, 94, .15);
  }
  100% {
    background: transparent;
  }
}

#lsp-last-sync.lsp-flash {
  animation: lspFlash 1.2s ease-out;
  border-radius: 6px;
  padding: 2px 6px;
}

@keyframes lspPulse {
  0% {
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25), 0 0 0 0 rgba(255, 87, 87, .35);
  }
  70% {
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25), 0 0 0 16px rgba(255, 87, 87, 0);
  }
  100% {
    box-shadow: 0 10px 24px rgba(37, 99, 235, .25), 0 0 0 0 rgba(255, 87, 87, 0);
  }
}

@keyframes lspSpin {
  to {
    transform: rotate(360deg);
  }
}

/* ===== Activity Feed ===== */
.lsp-activity {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lsp-activity-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6e9f2;
}

.lsp-activity-item .msg {
  flex: 1 1 60%;
}

.lsp-activity-item .badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.lsp-activity-item .ago {
  flex: 0 0 120px;
  text-align: right;
  opacity: 0.7;
  font-size: 12px;
}

.lsp-activity-item.type-info {
  border-left: 4px solid #3b82f6;
}

.lsp-activity-item.type-success {
  border-left: 4px solid #22c55e;
}

.lsp-activity-item.type-warning {
  border-left: 4px solid #f59e0b;
}

.lsp-activity-item.type-error {
  border-left: 4px solid #ef4444;
}

/* ===== Badges ===== */
.lsp-badge-success {
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.08);
  color: #166534;
}

.lsp-badge-wp { background: #dbeafe; color: #1e40af; }
.lsp-badge-both { background: #fef3c7; color: #92400e; }

/* ===== Floating Save Button ===== */
.wrap.lightsyncpro .submit,
.wrap.lightsyncpro .submit input[type="submit"],
.wrap.lightsyncpro .lsp-card .button-primary {
  display: none !important;
}

.wrap.lightsyncpro .full-save {
  display: inline-flex !important;
  position: fixed;
  right: 35px;
  bottom: 20px;
  z-index: 9999;
  min-width: 260px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  color: #fff !important;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, var(--lsp-primary, #ff5757), var(--lsp-primary-600, #2563eb));
  box-shadow: 0 10px 24px rgba(37, 99, 235, .25), 0 0 0 0 rgba(255, 87, 87, .35);
  transform: translateY(0);
  transition: box-shadow .25s ease, transform .2s ease, opacity .2s ease;
}

.cat-hidden {
  display: none !important;
}

.wrap.lightsyncpro .full-save.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.wrap.lightsyncpro .pulse-button {
  animation: lspPulse 1.6s ease-out infinite;
}

.wrap.lightsyncpro .full-save.is-dirty {
  animation: lspPulse 1.6s ease-out infinite;
}

.wrap.lightsyncpro .full-save.is-saving {
  opacity: .85;
  animation: none;
}

.wrap.lightsyncpro .full-save.is-saving::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .8);
  border-top-color: transparent;
  vertical-align: -2px;
  animation: lspSpin .9s linear infinite;
}

.wrap.lightsyncpro .full-save .status {
  display: inline-block !important;
  opacity: 0;
  transition: opacity .2s ease;
}

.wrap.lightsyncpro .full-save.is-saved .status {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .wrap.lightsyncpro .full-save,
  .wrap.lightsyncpro .full-save.is-dirty {
    transition: none;
    animation: none;
  }
}

/* ===== Background Canvas ===== */
.wrap.lightsyncpro {
  position: relative;
}

.wrap.lightsyncpro > * {
  position: relative;
  z-index: 1;
}

.wrap.lightsyncpro .lsp-bg-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .65;
  filter: saturate(1.05);
}

@media (prefers-reduced-motion:reduce) {
  .wrap.lightsyncpro .lsp-bg-canvas {
    display: none !important;
  }
}

/* ===== Base Styles ===== */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ededed;
  color: var(--lsp-text);
}

/* ===== Hero Section ===== */
.hero {
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, var(--lsp-primary), var(--lsp-primary-600));
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero:before {
  content: "";
  position: absolute;
  inset: -40px;
  background:
    radial-gradient(circle at 15% 35%, rgba(255,255,255,.22), transparent 20%),
    radial-gradient(circle at 65% 15%, rgba(255,255,255,.16), transparent 20%),
    radial-gradient(circle at 85% 65%, rgba(255,255,255,.14), transparent 20%);
  pointer-events: none;
  filter: saturate(1.1);
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }
}

.logo img {
  filter: drop-shadow(2px 4px 10px rgb(0,0,0,0.5)) !important;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: .2px;
  color: #ffffff;
}

.hero p {
  margin: 0;
  opacity: .92;
  line-height: 1.45;
  font-size: 13px;
  max-width: 64ch;
}

/* ===== KPIs ===== */
.kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width:900px) {
  .kpis {
    justify-content: flex-start;
  }
}

.kpi {
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  padding: 10px 12px;
  border-radius: 14px;
  min-width: 156px;
  backdrop-filter: blur(6px);
}

.kpi .label {
  font-size: 11px;
  opacity: .85;
  font-weight: 600;
}

.kpi .value {
  font-size: 14px;
  font-weight: 800;
  margin-top: 2px;
}

/* ===== Command Bar ===== */
.commandbar {
  margin-top: 14px;
  position: sticky !important;
  top: 3%;
  z-index: 3 !important;
  background: rgba(255,255,255,.92);
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(15,23,42,.08);
  backdrop-filter: blur(12px);
}

.commandbar-left {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.commandbar-left .pillrow {
  margin: 0;
}

.syncific-badge {
  display: flex;
  align-items: center;
  text-decoration: none;
  padding: 0;
  margin-right: 35px;
  flex-shrink: 0;
}

.syncific-badge:hover {
  opacity: 0.8;
}

.syncific-badge img {
  display: block;
}

@media (max-width: 980px) {
  .commandbar {
    flex-wrap: wrap;
  }
}

.pillrow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.pillrow .separator {
  color: #d1d5db;
  font-size: 10px;
  margin: 0 2px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  font-weight: 500;
  font-size: 13px;
  color: var(--lsp-subtext);
  box-shadow: none;
}

.pill strong {
  color: var(--lsp-text);
  font-weight: 600;
}

.pill.success {
  color: #16a34a;
}

.pill.muted {
  color: var(--lsp-subtext);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.15);
}

.dot.idle {
  background: #9ca3af;
  box-shadow: none;
}

/* ===== Buttons ===== */
.btn, .button-link-delete {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--lsp-primary), var(--lsp-primary-600));
  box-shadow: 0 12px 26px rgba(37,99,235,.22);
}

.btn.ghost, .button-link-delete {
  background: rgba(0,0,0,.04);
  border: none;
  color: var(--lsp-text);
  box-shadow: none;
}

.btn.ghost:hover, .button-link-delete:hover {
  background: rgba(0,0,0,.07);
}

.btn:active {
  transform: translateY(1px);
}

.btn.small {
  padding: 8px 12px;
  font-size: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* ===== Layout: Sidebar + Content ===== */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 22px;
  margin-top: 18px;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.side {
  position: sticky;
  top: 115px;
  align-self: start;
  height: max-content;
}

@media (max-width:1024px) {
  .side {
    position: static;
  }
}

.nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0,0,0,0.03);
  border: none;
  text-decoration: none;
  color: var(--lsp-text);
  font-weight: 700;
  font-size: 13px;
  box-shadow: none;
}

.nav a:hover {
  background: rgba(0,0,0,0.05);
}

.nav a.active {
  background: rgba(37,99,235,0.08);
  box-shadow: none;
  color: var(--lsp-primary-600);
}

/* ===== Section Styles ===== */
.section {
  padding: 20px 0 28px;
  border-bottom: 1px solid rgba(0,0,0,.06);
}

.section:last-child {
  border-bottom: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.section h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: .2px;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11.5px;
  padding: 6px 10px;
  border: none;
  background: rgba(0,0,0,.04);
  color: var(--lsp-subtext);
}

.badge.success {
  border: none;
  background: rgba(34,197,94,.1);
  color: #16a34a;
}

.badge.locked {
  border: none;
  background: rgba(245,158,11,.1);
  color: #d97706;
}

.badge.pro {
  background: linear-gradient(135deg, rgba(139,92,246,.12) 0%, rgba(245,158,11,.12) 100%);
  border: none;
  color: #7c3aed;
}

.lsp-pro-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  border-radius: 50%;
  cursor: help;
  z-index: 10;
  box-shadow: 0 0 0 2px rgba(139,92,246,.2);
}
.lsp-pro-dot:hover {
  box-shadow: 0 0 0 4px rgba(139,92,246,.25);
}
.lsp-pro-dot::after {
  content: 'Pro feature';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: #1e1b4b;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.lsp-pro-dot:hover::after {
  opacity: 1;
}

.badge.muted {
  opacity: .9;
}

/* ===== Panels ===== */
.panel {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(15,23,42,.06);
  padding: 20px;
  overflow: visible;
}

/* ===== Two Column Layout ===== */
.twocol {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 980px) {
  .twocol {
    grid-template-columns: 1fr;
  }
}

.help {
  background: rgba(255,255,255,.7);
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(15,23,42,.04);
}

.adobe {
  background: #fff;
  border: 1px dashed rgba(37,99,235,.35);
  border-radius: var(--radius);
  padding: 30px !important;
}

.adobe h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: #ff5757 !important;
}

.help h3 {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 900;
  color: var(--lsp-primary-600);
}

.help p {
  margin-bottom: 20px;
  color: var(--lsp-subtext);
  font-size: 12.5px;
  line-height: 1.45;
}

/* ===== Form Elements ===== */
.row {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

label {
  font-weight: 700;
  font-size: 12.5px;
}

input[type="text"], select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-size: 13px;
  background: rgba(0,0,0,0.04);
  outline: none;
  transition: all 0.15s ease;
}

input[type="text"]:focus, select:focus {
  background: #fff;
  box-shadow: 0 0 0 2px var(--lsp-primary);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.desc {
  color: var(--lsp-subtext);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: 8px;
}

/* ===== Toast (Alternative Style) ===== */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  min-width: 280px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #f9fafb;
  font-weight: 800;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .22s ease, transform .22s ease;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.toast .ico {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.toast.error .ico {
  background: radial-gradient(circle at 30% 20%, #fecaca, #ef4444);
}

.toast svg {
  width: 14px;
  height: 14px;
  stroke: #052e16;
}

.toast.error svg {
  stroke: #450a0a;
}

/* ===== License & Usage Table Fixes ===== */
#lsp-activations {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

#lsp-activations thead th {
  text-align: left;
  padding: 12px 10px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 2px solid #e5e7eb;
  background: #f9fafb;
}

#lsp-activations thead th:first-child {
  width: 35%;
}

#lsp-activations thead th:nth-child(2) {
  width: 30%;
}

#lsp-activations thead th:nth-child(3) {
  width: 20%;
}

#lsp-activations thead th:last-child {
  width: 15%;
  text-align: right;
}

#lsp-activations tbody td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  vertical-align: middle;
  word-break: break-word;
}

#lsp-activations tbody td:last-child {
  text-align: right;
}

/* ===== Mobile: Hide table, show on desktop ===== */
.hide-mobile {
  display: table;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* ===== Activity List Mobile Fixes ===== */
@media (max-width: 768px) {
  .lsp-activity-item {
    flex-wrap: wrap;
    gap: 6px;
  }
  
  .lsp-activity-item .msg {
    flex: 1 1 100%;
    font-size: 13px;
    word-break: break-word;
  }
  
  .lsp-activity-item .badge {
    font-size: 10px;
    padding: 2px 6px;
  }
  
  .lsp-activity-item .ago {
    flex: 0 0 auto;
    font-size: 11px;
    text-align: left;
  }
  
  .lsp-activity-card .twocol {
    grid-template-columns: 1fr !important;
  }
  
  .lsp-activity-card .help {
    display: none;
  }
}

/* ===== Usage Bars Section ===== */
.lsp-bars {
  overflow: hidden;
}

.lsp-bars > div {
  margin-bottom: 8px;
}

.lsp-bars > div:last-child {
  margin-bottom: 0;
}

/* ===== AI Insights Mobile Responsive ===== */

/* AI Tab buttons */
@media (max-width: 600px) {
  [data-ai-tab] {
    padding: 10px 12px !important;
    font-size: 12px !important;
  }
  
  [data-ai-tab] .lsp-source-status {
    display: none;
  }
}

/* Performance insights grid */
@media (max-width: 768px) {
  /* Top performers grid */
  #lsp-performance-insights [style*="display:flex"][style*="flex-wrap:wrap"] {
    gap: 8px !important;
  }
  
  /* Winner/swap candidate cards */
  #lsp-performance-insights [style*="display:flex"][style*="align-items:center"][style*="gap:10px"][style*="padding:10px"] {
    padding: 8px 10px !important;
    flex: 1 1 100% !important;
  }
  
  /* Summary footer stats */
  #lsp-performance-insights [style*="display:flex"][style*="gap:20px"][style*="font-size:12px"] {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  
  /* Export/clear buttons row */
  #lsp-performance-insights [style*="display:flex"][style*="flex-wrap:wrap"][style*="gap:10px"] {
    flex-direction: column;
    align-items: stretch !important;
  }
  
  #lsp-performance-insights [style*="margin-left:auto"] {
    margin-left: 0 !important;
    margin-top: 8px;
    text-align: center;
  }
}

/* A/B Testing Panel */
@media (max-width: 600px) {
  /* A/B test form grid - stack vertically */
  #lsp-ab-form-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* A/B test result cards - stack vertically */
  .lsp-ab-result-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Image picker row */
  #lsp-ai-performance-content [style*="display:flex"][style*="gap:8px"][style*="margin-bottom:8px"] {
    flex-wrap: wrap;
  }
  
  #lsp-ai-performance-content .lsp-ab-picker {
    flex: 1 1 100%;
    justify-content: center;
  }
  
  /* Preview cards */
  #lsp-ai-performance-content [id^="lsp-ab-preview-"] {
    padding: 6px !important;
  }
  
  #lsp-ai-performance-content [id^="lsp-ab-preview-"] img {
    width: 40px !important;
    height: 40px !important;
  }
}

/* Data retention row */
@media (max-width: 600px) {
  #lsp-ai-performance-content [style*="display:flex"][style*="justify-content:space-between"][style*="flex-wrap:wrap"] {
    flex-direction: column;
    gap: 12px !important;
  }
  
  #lsp-tracking-retention {
    width: 100%;
  }
}

/* AI Visual settings table */
@media (max-width: 600px) {
  #lsp-ai-visual-content .form-table th,
  #lsp-ai-visual-content .form-table td {
    display: block;
    padding: 6px 0 !important;
  }
  
  #lsp-ai-visual-content .form-table th {
    padding-bottom: 4px !important;
  }
  
  #lsp-ai-visual-content select,
  #lsp-ai-visual-content input[type="password"] {
    width: 100% !important;
  }
}

/* Suggestions cards */
@media (max-width: 480px) {
  #lsp-suggestions > div {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  
  #lsp-suggestions > div > span:first-child {
    font-size: 24px !important;
  }
}

/* ===== Toolbar Mobile Fixes ===== */
@media (max-width: 600px) {
  #lsp-toolbar {
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: center !important;
  }
  
  #lsp-toolbar button {
    font-size: 12px !important;
  }
  
  /* Hide text labels on very small screens */
  #lsp-toolbar .lsp-helpers-label,
  #lsp-toolbar button span:not(.lsp-helpers-label) {
    white-space: nowrap;
  }
}

@media (max-width: 400px) {
  #lsp-toolbar button {
    font-size: 11px !important;
    gap: 3px !important;
  }
  
  #lsp-toolbar svg {
    width: 12px !important;
    height: 12px !important;
  }
}

/* ===== Source Tabs Mobile ===== */
@media (max-width: 768px) {
  .lsp-source-tabs {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  
  .lsp-source-tab {
    min-width: 0 !important;
    padding: 12px 8px !important;
  }
  
  .lsp-source-tab .lsp-source-icon {
    width: 36px !important;
    height: 36px !important;
  }
  
  .lsp-source-tab .lsp-source-icon svg {
    width: 20px !important;
    height: 20px !important;
  }
  
  .lsp-source-tab .lsp-source-name {
    font-size: 12px !important;
  }
  
  .lsp-source-tab .lsp-source-status {
    font-size: 10px !important;
  }
  
  /* Hide Add Source button on mobile */
  .lsp-source-tab.lsp-source-add {
    display: none !important;
  }
}