/* Internal Links — clean GSC layout + purple #5A47B0 */
.mirolabs-gsc-page .mirolabs-ilx-wrap {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111827;
}
.mirolabs-gsc-page .mirolabs-ilx-wrap,
.mirolabs-gsc-page .mirolabs-ilx-wrap * {
  box-sizing: border-box;
}

/* ===== HERO ===== */
.mirolabs-gsc-page .mirolabs-ilx-wrap .ilx-hero {
  margin: 0 0 16px;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid var(--gsc-accent, #5A47B0);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}
.ilx-hero-pill {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--gsc-accent-soft, #f3f0fa);
  border: 1px solid #e8e2f8;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ilx-hero-pill img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 4px;
}
.ilx-hero-pill-fallback {
  font-weight: 600;
  font-size: 11px;
  color: var(--gsc-accent, #5A47B0);
}
.ilx-hero-main { min-width: 0; }
.ilx-hero-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.ilx-hero-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.ilx-hero-tag {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--gsc-accent-soft, #f3f0fa);
  border: 1px solid #e8e2f8;
  color: var(--gsc-accent, #5A47B0);
  font-weight: 600;
}
.ilx-hero-sub {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #374151;
  line-height: 1.5;
}
.ilx-hero-sub strong { font-weight: 600; color: #374151; }
.ilx-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ilx-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #374151;
}
.ilx-chip strong { font-weight: 600; color: #111827; }
.ilx-chip span { color: #374151; font-size: 11px; }
.ilx-chip-ux { background: #eff6ff; border-color: #dbeafe; }
.ilx-chip-seo { background: #f0fdf4; border-color: #bbf7d0; }
.ilx-chip-fast { background: var(--gsc-accent-soft, #f3f0fa); border-color: #e8e2f8; }
.ilx-hero-tip {
  justify-self: end;
  min-width: 240px;
  max-width: 280px;
  background: #fafafa;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  border-top: 2px solid var(--gsc-accent, #5A47B0);
}
.ilx-tip-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #111827;
}
.ilx-tip-title strong { font-weight: 600; }
.ilx-tip-ico { font-size: 14px; line-height: 1; }
.ilx-tip-sub {
  margin-top: 4px;
  font-size: 11px;
  color: #374151;
  line-height: 1.4;
}
.ilx-tip-hl {
  color: var(--gsc-accent, #5A47B0);
  font-weight: 600;
}

/* ===== LAYOUT ===== */
.ilx-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Stats bar */
.ilx-stats-bar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ilx-stats-slot {
  flex: 1;
  min-width: 0;
}
.ilx-stats-loading {
  font-size: 13px;
  color: #374151;
  padding: 8px 0;
}
.ilx-stats-bar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ilx-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  white-space: nowrap;
}
.ilx-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #9ca3af;
}
.ilx-status-pill[data-state="busy"] {
  color: #4a3a96;
  background: var(--gsc-accent-soft, #f3f0fa);
  border-color: #e8e2f8;
}
.ilx-status-pill[data-state="busy"]::before {
  background: var(--gsc-accent, #5A47B0);
  animation: ilx-pulse 1.2s ease-in-out infinite;
}
.ilx-status-pill[data-state="ok"] {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.ilx-status-pill[data-state="ok"]::before {
  background: #16a34a;
}
.ilx-status-pill[data-state="err"] {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}
.ilx-status-pill[data-state="err"]::before {
  background: #dc2626;
}
@keyframes ilx-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* KPI grid */
.ilx-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.ilx-kpi {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
}
.ilx-kpi-label {
  font-size: 11px;
  color: #374151;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ilx-kpi-val {
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.2;
}
.ilx-kpi-val.ilx-kpi-warn { color: #dc2626; }
.ilx-kpi-val.ilx-kpi-accent { color: var(--gsc-accent, #5A47B0); }
.ilx-kpi-sub {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

/* Panels */
.ilx-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.ilx-panel-head { margin-bottom: 14px; }
.ilx-panel-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.ilx-panel-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.ilx-panel-desc {
  margin: 0;
  font-size: 12px;
  color: #374151;
  line-height: 1.45;
}
.ilx-panel-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ilx-note {
  font-size: 11px;
  color: #374151;
  white-space: nowrap;
}

/* Setup steps */
.ilx-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0;
  align-items: stretch;
}
.ilx-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fafafa;
  border: 1px solid #f0f0f0;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ilx-step.is-running {
  border-color: rgba(90, 71, 176, 0.28);
  background: var(--gsc-accent-soft, #f3f0fa);
  box-shadow: 0 0 0 3px rgba(90, 71, 176, 0.08);
}
.ilx-step-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.ilx-step-progress {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eef0f2;
}
.ilx-step-progress.is-active {
  display: block;
}
.ilx-step-progress.is-error .ilx-progress-track {
  background: #fecaca;
}
.ilx-step-progress.is-error .ilx-progress-bar {
  background: #dc2626;
}
.ilx-progress-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.ilx-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gsc-accent, #5A47B0), #6b5bc4);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.ilx-progress-msg {
  margin: 8px 0 0;
  font-size: 12px;
  color: #374151;
  line-height: 1.45;
}
.ilx-progress-msg.is-error {
  color: #991b1b;
  font-weight: 500;
}
.ilx-btn.is-loading {
  opacity: 0.85;
  pointer-events: none;
}
.ilx-stats-error {
  color: #991b1b !important;
}
.ilx-step-num {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--gsc-accent, #5A47B0);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ilx-step-body { flex: 1; min-width: 0; }
.ilx-step-title {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
}
.ilx-step-desc {
  font-size: 11px;
  color: #374151;
  margin-top: 2px;
}
.ilx-step-divider {
  width: 24px;
  align-self: center;
  height: 2px;
  background: linear-gradient(90deg, #e5e7eb, var(--gsc-accent, #5A47B0), #e5e7eb);
  margin: 0 4px;
}

/* Split columns */
.ilx-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}

/* Buttons */
.ilx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: auto;
  margin: 0;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.ilx-btn-primary {
  background: var(--gsc-accent, #5A47B0) !important;
  border: 1px solid #4a3a96 !important;
  color: #fff !important;
  box-shadow: none;
}
.ilx-btn-primary:hover,
.ilx-btn-primary:focus {
  background: #4a3a96 !important;
  border-color: #3d2f7d !important;
  color: #fff !important;
}
.ilx-btn-ghost {
  background: #fff !important;
  border: 1px solid #d1d5db !important;
  color: #374151 !important;
}
.ilx-btn-ghost:hover,
.ilx-btn-ghost:focus {
  border-color: var(--gsc-accent, #5A47B0) !important;
  color: var(--gsc-accent, #5A47B0) !important;
  background: var(--gsc-accent-soft, #f3f0fa) !important;
}
.ilx-btn-sm {
  padding: 5px 10px;
  font-size: 11px;
}

/* Table slot + empty */
.ilx-table-slot { min-height: 48px; }
.ilx-table-slot-empty .ilx-empty { display: block; }
.ilx-empty {
  padding: 24px 16px;
  text-align: center;
  font-size: 13px;
  color: #374151;
  background: #fafafa;
  border: 1px dashed #e5e7eb;
  border-radius: 10px;
}
.ilx-empty.ilx-empty-ok {
  color: #166534;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

/* Tables */
.mirolabs-ilx-wrap table.ilx-table,
.mirolabs-ilx-wrap table.widefat {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid #e5e7eb !important;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: none;
  margin: 0;
}
.mirolabs-ilx-wrap table.ilx-table thead th,
.mirolabs-ilx-wrap table.widefat thead th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600 !important;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f9fafb !important;
  border-bottom: 1px solid #e5e7eb !important;
}
.mirolabs-ilx-wrap table.ilx-table tbody td,
.mirolabs-ilx-wrap table.widefat tbody td {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 400 !important;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}
.mirolabs-ilx-wrap table.ilx-table tbody tr:last-child td,
.mirolabs-ilx-wrap table.widefat tbody tr:last-child td {
  border-bottom: none;
}
.mirolabs-ilx-wrap table.ilx-table tbody tr:hover td,
.mirolabs-ilx-wrap table.widefat tbody tr:hover td {
  background: #fafafa;
}
.ilx-post-title {
  font-weight: 500;
  color: #111827;
  display: block;
}
.ilx-post-url {
  font-size: 11px;
  color: #374151;
  margin-top: 2px;
  word-break: break-all;
}
.ilx-num {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.ilx-num-warn { color: #dc2626; font-weight: 600; }
.ilx-num-good { color: var(--gsc-accent, #5A47B0); font-weight: 600; }

/* Responsive */
@media (max-width: 1100px) {
  .ilx-split { grid-template-columns: 1fr; }
  .ilx-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .mirolabs-gsc-page .mirolabs-ilx-wrap .ilx-hero {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .mirolabs-gsc-page .mirolabs-ilx-wrap .ilx-hero-tip {
    grid-column: 1 / -1;
    max-width: none;
  }
  .ilx-steps {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ilx-step-divider {
    width: auto;
    height: 1px;
    margin: 0;
    background: #e5e7eb;
  }
  .ilx-stats-bar {
    flex-direction: column;
  }
  .ilx-stats-bar-meta {
    justify-content: flex-end;
    width: 100%;
  }
}
@media (max-width: 520px) {
  .ilx-kpi-grid { grid-template-columns: 1fr 1fr; }
  .ilx-step-row {
    flex-wrap: wrap;
  }
  .ilx-step .ilx-btn { width: 100%; margin-top: 4px; }
}

/* Utility (metabox + legacy) */
.mirolabs-ilx-select-clean { border: none; background: transparent; outline: none; }
.mirolabs-ilx-orphan-badge { border-color: #fecaca; background: #fef2f2; }
.mirolabs-ilx-th-90 { width: 72px; }
.mirolabs-ilx-th-140 { width: 100px; }
.mirolabs-ilx-th-26 { width: 26px; }
.mirolabs-ilx-div-mt { margin: 6px 0 8px; }
.mirolabs-ilx-desc-mt { margin-top: 10px; }
