/* Update Syntax Error Detector — same shape/size as the Deecliq Data
   Transfer tool: centered hero, flat no-shadow card, same button system. */
.csed-fit.csed-scope {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 1600px; margin: 0 auto;
  padding: 90px 4vw 60px;
}

.csed-hero { text-align: center; flex-shrink: 0; }
.csed-hero h1 {
  font-size: 1.5rem !important; font-weight: 800 !important;
  color: var(--brand, #f59e0b) !important;
  margin: 0 0 4px !important;
}
#csedScope .csed-hero p {
  font-size: .85rem !important; color: var(--txt-2, #64748b) !important;
  margin: 0 !important;
}

#csedScope .csed-card {
  max-width: 100% !important; width: 100%;
  padding: 24px 32px !important;
  background: var(--page-bg, #f8fafc) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  box-shadow: none !important;
  margin: 0 auto !important;
}

.csed-textarea {
  width: 100%; height: 220px; resize: vertical;
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  background: var(--surface, #fff); color: var(--txt, #0f172a);
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: .82rem; line-height: 1.6;
  padding: 12px;
}
.csed-textarea:focus { outline: none; border-color: var(--brand, #f59e0b); }

.hidden { display: none !important; }

/* ── Input mode toggle (Paste vs Upload) — one small compact pill, not two
   full-width buttons. ── */
.csed-mode-toggle {
  display: flex; gap: 4px; margin: 0 auto 18px; width: max-content;
  background: var(--surface, #fff); border: 1px solid var(--border, #e2e8f0);
  border-radius: 999px; padding: 4px;
}
.csed-mode-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  border: none; background: none; cursor: pointer;
  padding: 7px 16px; border-radius: 999px;
  font-weight: 700; font-size: .8rem; color: var(--txt-2, #64748b);
  transition: background .15s ease, color .15s ease;
}
.csed-mode-btn:hover { color: var(--brand, #f59e0b); }
.csed-mode-btn.csed-mode-active { background: var(--brand, #f59e0b); color: #fff; }

/* ── Upload dropzone + file list ── */
.csed-scope .csed-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 220px; padding: 26px 20px;
  border: 2px dashed var(--brand, #f59e0b); border-radius: 14px;
  cursor: pointer; text-align: center; color: var(--txt, #0f172a);
  background: transparent; transition: border-color .2s ease, background .2s ease;
}
.csed-scope .csed-dropzone:hover,
.csed-scope .csed-dropzone.csed-dragover {
  border-color: var(--brand-dark, #d97706); background: rgba(245,158,11,.05);
}
.csed-scope .csed-dropzone i {
  color: var(--brand, #f59e0b); font-size: 2.2rem;
  animation: csedIconFloat 2.4s ease-in-out infinite;
}
@keyframes csedIconFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .csed-scope .csed-dropzone i { animation: none; } }
.csed-drop-title { font-weight: 700; margin-top: 10px; font-size: .95rem; color: var(--txt, #0f172a); }
.csed-drop-sub { font-size: .8rem; opacity: .65; margin-top: 4px; color: var(--txt-2, #64748b); }

.csed-shake { animation: csedShake .4s ease; }
@keyframes csedShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-8px); }
  40%      { transform: translateX(7px); }
  60%      { transform: translateX(-5px); }
  80%      { transform: translateX(3px); }
}
@media (prefers-reduced-motion: reduce) { .csed-shake { animation: none; } }

.csed-file-list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 16px 0 8px; font-size: .82rem; color: var(--txt-2, #64748b); font-weight: 600;
}
.csed-add-more { color: var(--brand, #f59e0b); cursor: pointer; font-weight: 700; }
.csed-add-more:hover { text-decoration: underline; }

.csed-file-list { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; }
.csed-file-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 8px;
  border-radius: 10px; background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
}
.csed-chip-icon { color: var(--brand, #f59e0b); font-size: 1rem; flex-shrink: 0; }
.csed-chip-name { flex: 1; min-width: 0; font-weight: 600; font-size: .85rem; color: var(--txt, #0f172a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.csed-chip-size { font-size: .76rem; color: var(--txt-2, #64748b); flex-shrink: 0; }
.csed-chip-remove {
  width: 26px; height: 26px; flex-shrink: 0; border: none; border-radius: 50%;
  background: var(--red, #ef4444); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .8rem;
  transition: background .15s ease, transform .15s ease;
}
.csed-chip-remove:hover { background: #dc2626; transform: scale(1.08); }

/* File-grouped result headers when validating multiple uploaded files */
.csed-file-header {
  font-weight: 800; font-size: .85rem; color: var(--brand, #f59e0b);
  padding: 14px 0 6px; border-top: 1px solid var(--border, #e2e8f0);
}
.csed-error:first-child.csed-file-header,
.csed-results > .csed-file-header:first-child { border-top: none; padding-top: 12px; }

#csedScope .controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 20px 0; }
#csedScope #csedDetectBtn {
  background: linear-gradient(135deg, var(--brand, #f59e0b), var(--brand-dark, #d97706));
  border: none; padding: 13px 26px; font-weight: 700; font-size: .95rem;
  border-radius: 12px; box-shadow: 0 10px 24px rgba(245,158,11,.35);
  transition: transform .15s ease, box-shadow .15s ease;
}
#csedScope #csedDetectBtn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(245,158,11,.45); }
#csedScope .btn-warning { padding: 13px 26px; font-weight: 700; font-size: .95rem; border-radius: 12px; }

/* ── Results screen — its own separate step, swapped in for the input
   view entirely rather than appended below it. ── */
.csed-result-head {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.05rem; color: var(--brand, #f59e0b);
  margin-bottom: 14px;
}

.csed-summary {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-bottom: 14px;
}
.csed-summary-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 10px; font-size: .85rem; font-weight: 700;
  background: var(--page-bg, #f8fafc); border: 1px solid var(--border, #e2e8f0); color: var(--txt, #0f172a);
}
.csed-summary-chip.csed-summary-ok { color: #16a34a; border-color: #16a34a; background: var(--green-bg, #f0fdf4); }
.csed-summary-chip.csed-summary-bad { color: var(--red, #ef4444); border-color: var(--red, #ef4444); background: var(--red-bg, #fef2f2); }

/* ── Results — one unified box, numbered rows, sizes to content. ── */
.csed-results {
  padding: 4px 18px; border-radius: 12px; background: var(--surface, #fff);
  font-family: 'SFMono-Regular', Consolas, monospace; font-size: .82rem;
  overflow-y: auto; white-space: pre-wrap;
  max-height: 60vh;
  border: 1px solid var(--border, #e2e8f0);
  user-select: text; cursor: text;
}
/* A quick inline guard message (e.g. "paste something first") shown right
   below the buttons on THIS same input screen — unlike a real validation
   result, this never warrants switching to the separate Results screen. */
.csed-inline-error {
  display: flex; align-items: center; gap: 8px;
  margin-top: -6px; margin-bottom: 16px; padding: 10px 14px;
  border-radius: 10px; background: var(--red-bg, #fef2f2);
  border: 1px solid var(--red-bd, #fecaca); color: var(--red, #ef4444);
  font-size: .85rem; font-weight: 600;
}

.csed-error, .csed-success {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; line-height: 1.5; background: none;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.csed-error:last-child, .csed-success:last-child { border-bottom: none; }
.csed-error { color: var(--txt, #0f172a); font-weight: 600; }
.csed-success { color: var(--txt, #0f172a); font-weight: 600; }

.csed-row-num {
  flex-shrink: 0; margin-top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 800;
  border: 2px solid;
}
.csed-error .csed-row-num { color: var(--red, #ef4444); border-color: var(--red, #ef4444); }
.csed-success .csed-row-num { color: #16a34a; border-color: #16a34a; }

.csed-features {
  margin-top: 24px; padding: 18px 20px;
  border-radius: 14px; background: rgba(245,158,11,.06);
  border: 1px solid rgba(245,158,11,.2);
}
.csed-features-title {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: .85rem; color: var(--brand, #f59e0b);
  margin-bottom: 14px;
}
.csed-features-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 20px;
}
.csed-feature-item {
  display: flex; align-items: center; gap: 8px;
  font-size: .82rem; color: var(--txt-2, #64748b);
}
.csed-feature-item i { color: #16a34a; font-size: .75rem; }

@media (max-width: 700px) {
  .csed-features-list { grid-template-columns: 1fr; }
}
