/* ===========================================================
   Google Suggest Detector — design cohérent (gold/dark)
   Inspiré de /tools/image-converter
   =========================================================== */
.sg-page * { box-sizing: border-box; }

.sg-page {
  background:
    radial-gradient(900px 500px at 10% 0%, rgba(0,200,255,0.10), transparent 55%),
    radial-gradient(900px 500px at 80% 10%, rgba(255,165,0,0.09), transparent 55%),
    radial-gradient(900px 500px at 50% 95%, rgba(212,175,55,0.06), transparent 60%),
    #070707;
  min-height: 100vh;
  color: #d7d8dc;
  padding: 28px 20px 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

.sg-inner {
  max-width: 1280px;
  margin: 0 auto;
}

/* ── Breadcrumb ── */
.sg-breadcrumb {
  font-size: 0.82rem;
  color: #6b7280;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sg-breadcrumb a { color: #9aa0a8; text-decoration: none; }
.sg-breadcrumb a:hover { color: #d4af37; }
.sg-breadcrumb span { color: #4b5563; }

/* ── Header ── */
.sg-header { text-align: center; margin-bottom: 24px; }
.sg-header h1 {
  font-size: 2em;
  font-weight: 750;
  color: #d4af37;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}
.sg-header p {
  font-size: 1.05em;
  color: #9aa0a8;
  max-width: 720px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Quota bar ── */
.sg-quota-bar { display: flex; justify-content: center; margin-bottom: 28px; }
.sg-quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  color: #9aa0a8;
}
.sg-quota-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #b8f39b;
  box-shadow: 0 0 6px rgba(184,243,155,0.6);
}
.sg-quota-badge.is-low .sg-quota-dot { background: #f7b36a; box-shadow: 0 0 6px rgba(247,179,106,0.7); }
.sg-quota-badge.is-empty .sg-quota-dot { background: #ff6b6b; box-shadow: 0 0 6px rgba(255,107,107,0.7); }
.sg-quota-text { color: #d7d8dc; font-weight: 500; }

/* ── Form card ── */
.sg-form-card {
  max-width: 920px;
  margin: 0 auto 32px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px 28px;
}
.sg-form-row {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px;
}
.sg-form-row label,
.sg-form-row legend {
  font-size: 0.82rem;
  font-weight: 700;
  color: #9aa0a8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.sg-form-row label small { text-transform: none; letter-spacing: 0; color: #6b7280; font-weight: 500; }

.sg-form-row textarea,
.sg-form-row select,
.sg-form-row input[type="text"] {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d7d8dc;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.sg-form-row textarea:focus,
.sg-form-row select:focus { border-color: #d4af37; }
.sg-form-row textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}
.sg-form-row textarea::placeholder { color: #4b5563; }

.sg-form-grid {
  display: grid;
  grid-template-columns: 160px 160px;
  gap: 18px;
}

.sg-btn-primary {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid #d4af37;
  color: #d4af37;
  border-radius: 10px;
  padding: 13px 22px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s, color 0.15s;
}
.sg-btn-primary:hover { background: rgba(212,175,55,0.12); }
.sg-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.sg-btn-ghost {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #d7d8dc;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sg-btn-ghost:hover {
  background: rgba(212,175,55,0.12);
  color: #d4af37;
  border-color: #d4af37;
}

/* ── Loader ── */
.sg-loader { text-align: center; padding: 32px; color: #9aa0a8; }
.sg-loader p { margin: 0; font-size: 0.92rem; }
.sg-loader p small { color: #6b7280; font-size: 0.82rem; }
.sg-spinner {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  border: 3px solid rgba(212,175,55,0.15);
  border-top-color: #d4af37;
  border-radius: 50%;
  animation: sg-spin 0.9s linear infinite;
}
@keyframes sg-spin { to { transform: rotate(360deg); } }

/* ── Errors ── */
.sg-error {
  max-width: 920px;
  margin: 0 auto 24px;
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.3);
  color: #ffb0b0;
  padding: 14px 20px;
  border-radius: 10px;
  font-size: 0.92rem;
}

/* ── Results ── */
.sg-results { margin-top: 8px; }

.sg-results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}
.sg-tabs { display: flex; gap: 6px; }
.sg-tab {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #9aa0a8;
  padding: 9px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
}
.sg-tab:hover { color: #d4af37; border-color: #d4af37; }
.sg-tab.is-active {
  background: rgba(212,175,55,0.12);
  border-color: #d4af37;
  color: #d4af37;
}
.sg-actions { display: flex; gap: 8px; }

.sg-keyword-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.sg-keyword-switch button {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  color: #9aa0a8;
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sg-keyword-switch button:hover { color: #d4af37; border-color: #d4af37; }
.sg-keyword-switch button.is-active {
  background: rgba(212,175,55,0.15);
  border-color: #d4af37;
  color: #d4af37;
}

.sg-tab-panel { display: none; }
.sg-tab-panel.is-active { display: block; }

/* ── Mindmap ── */
#sg-mindmap {
  background: radial-gradient(ellipse at center, #0d0d10 0%, #050507 80%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  height: 760px;
  overflow: hidden;
  position: relative;
}
#sg-mindmap svg { display: block; width: 100%; height: 100%; cursor: grab; }
#sg-mindmap svg:active { cursor: grabbing; }
.sg-hint { text-align: center; color: #6b7280; font-size: 0.82rem; margin-top: 12px; }

.sg-node circle {
  stroke-width: 2px;
  transition: r 0.2s, stroke-width 0.2s;
  cursor: pointer;
}
.sg-node:hover circle { stroke-width: 3.5px; }
.sg-node text {
  font: 12px -apple-system, "Segoe UI", sans-serif;
  fill: #e6e7ec;
  pointer-events: none;
  paint-order: stroke;
  stroke: rgba(0,0,0,0.85);
  stroke-width: 3px;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sg-node--root circle { fill: #d4af37; stroke: #f4d76a; }
.sg-node--root text { font-size: 15px; font-weight: 700; fill: #f4d76a; }
.sg-link {
  fill: none;
  stroke-opacity: 0.55;
  stroke-width: 1.6px;
}

.sg-tooltip {
  position: absolute;
  background: rgba(13,13,16,0.97);
  border: 1px solid #d4af37;
  color: #d7d8dc;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.84rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  max-width: 320px;
  z-index: 100;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
}
.sg-tooltip strong { color: #d4af37; }
.sg-tooltip small { color: #6b7280; }

/* ── Table (fond clair pour lisibilité maximale) ── */
.sg-table-wrapper {
  background: #ffffff;
  border: 1px solid rgba(212,175,55,0.4);
  border-radius: 14px;
  padding: 18px;
}
.sg-table-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
#sg-table-filter {
  flex: 1;
  background: #f7f7f9;
  border: 1px solid #d8d8de;
  color: #1a1a22;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.15s;
}
#sg-table-filter:focus { border-color: #d4af37; }
#sg-table-filter::placeholder { color: #888; }

.sg-btn-copy {
  background: #d4af37;
  border: 1px solid #d4af37;
  color: #1a1a22;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
}
.sg-btn-copy:hover { background: #e5c14a; }
.sg-btn-copy:active { transform: scale(0.97); }
.sg-btn-copy.is-copied { background: #b8f39b; border-color: #b8f39b; }

.sg-table-scroll {
  max-height: 640px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid #e6e6ec;
}
#sg-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; background: #ffffff; }
#sg-table thead {
  position: sticky;
  top: 0;
  background: #1a1a22;
  z-index: 1;
}
#sg-table th {
  text-align: left;
  padding: 12px 16px;
  color: #d4af37;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  border-bottom: 2px solid #d4af37;
}
#sg-table td {
  text-align: left;
  padding: 11px 16px;
  color: #1a1a22;
  border-bottom: 1px solid #ececf0;
}
#sg-table tbody tr:nth-child(even) td { background: #fafafc; }
#sg-table tbody tr:hover td { background: #fff3c8; }
#sg-table td:nth-child(1) { color: #6d28d9; font-weight: 600; }
#sg-table td:nth-child(2) { color: #1a1a22; font-weight: 500; }
#sg-table td:nth-child(3) { color: #6b7280; text-align: center; font-variant-numeric: tabular-nums; }
#sg-table td:nth-child(4) { color: #6b7280; text-align: center; font-variant-numeric: tabular-nums; }
#sg-table td:nth-child(5) { text-align: center; }
#sg-table td:nth-child(6) { text-align: center; color: #b8860b; font-weight: 700; font-variant-numeric: tabular-nums; }

.sg-intent-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: lowercase;
}
.sg-intent-pill.intent-informational { background: #d1f3ec; color: #0f766e; }
.sg-intent-pill.intent-commercial    { background: #fde6c8; color: #9a4a00; }
.sg-intent-pill.intent-transactional { background: #fcd6e3; color: #9f1239; }
.sg-intent-pill.intent-navigational  { background: #e4dcfb; color: #5b21b6; }

/* ── Insights ── */
.sg-insights {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px 28px;
}
.sg-insights-title {
  color: #d4af37;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 28px 0 14px;
}
.sg-insights-title:first-of-type { margin-top: 8px; }

.sg-insights-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 10px;
}
.sg-stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sg-stat-label { color: #9aa0a8; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.sg-stat-value { color: #d4af37; font-size: 1.6rem; font-weight: 750; }

.sg-intent-bars { display: flex; flex-direction: column; gap: 10px; }
.sg-intent-row { display: grid; grid-template-columns: 170px 1fr 60px; align-items: center; gap: 12px; }
.sg-intent-label { color: #d7d8dc; font-size: 0.88rem; font-weight: 600; }
.sg-intent-bar-bg {
  height: 12px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
}
.sg-intent-bar-fg {
  height: 100%;
  border-radius: 100px;
  transition: width 0.45s ease;
}
.sg-intent-bar-fg.intent-informational { background: linear-gradient(90deg, #7be7d6, #4fc3b0); }
.sg-intent-bar-fg.intent-commercial    { background: linear-gradient(90deg, #f7b36a, #e58a2b); }
.sg-intent-bar-fg.intent-transactional { background: linear-gradient(90deg, #ff9fbf, #e54a7a); }
.sg-intent-bar-fg.intent-navigational  { background: linear-gradient(90deg, #8b5cf6, #6d3fd9); }
.sg-intent-count { color: #9aa0a8; font-size: 0.85rem; text-align: right; font-variant-numeric: tabular-nums; }

.sg-insights-header-row { display: flex; justify-content: space-between; align-items: center; margin: 28px 0 14px; gap: 14px; flex-wrap: wrap; }
.sg-insights-header-row .sg-insights-title { margin: 0; }

.sg-top-terms { display: flex; flex-direction: column; gap: 6px; max-height: 720px; overflow-y: auto; padding-right: 6px; }
.sg-top-term {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 9px 14px;
}
.sg-top-term-score {
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.10));
  border: 1px solid rgba(212,175,55,0.4);
  color: #f4d76a;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 5px 0;
  border-radius: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.sg-top-term-text { color: #e6e7ec; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-top-term-meta { color: #6b7280; font-size: 0.78rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sg-top-term-sim { color: #a78bfa; font-weight: 600; }
.sg-top-term-intent {
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 100px;
  font-weight: 600;
  text-transform: lowercase;
}
.sg-top-term-intent.intent-informational { background: rgba(123,231,214,0.15); color: #7be7d6; }
.sg-top-term-intent.intent-commercial    { background: rgba(247,179,106,0.15); color: #f7b36a; }
.sg-top-term-intent.intent-transactional { background: rgba(255,159,191,0.15); color: #ff9fbf; }
.sg-top-term-intent.intent-navigational  { background: rgba(139,92,246,0.15); color: #b794f6; }

/* ── Brief éditorial ── */
.sg-brief-wrapper {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px 28px;
}
.sg-brief-toolbar {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.sg-btn-brief { width: auto !important; margin-top: 0 !important; padding: 12px 24px !important; }
.sg-brief-hint { color: #6b7280; font-size: 0.82rem; }
.sg-brief-loader { text-align: center; padding: 40px 0; color: #9aa0a8; }
.sg-brief-loader p { margin: 12px 0 0; font-size: 0.92rem; }
.sg-brief-error {
  background: rgba(255,107,107,0.08);
  border: 1px solid rgba(255,107,107,0.3);
  color: #ffb0b0;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-top: 12px;
}

.sg-brief-content { margin-top: 18px; display: flex; flex-direction: column; gap: 22px; }
.sg-brief-section {
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 18px 22px;
}
.sg-brief-section h3 {
  color: #d4af37;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin: 0 0 12px;
}
.sg-brief-section p, .sg-brief-section li { color: #d7d8dc; font-size: 0.92rem; line-height: 1.55; }
.sg-brief-section ul { margin: 0; padding-left: 20px; }
.sg-brief-summary p { color: #e6e7ec; font-size: 1rem; line-height: 1.6; }
.sg-brief-intent-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 10px;
}
.sg-brief-angle { color: #f4d76a; font-style: italic; margin-bottom: 12px; display: block; }

.sg-brief-clusters { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sg-brief-cluster {
  background: rgba(212,175,55,0.06);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 8px;
  padding: 14px;
}
.sg-brief-cluster h4 { color: #d4af37; margin: 0 0 6px; font-size: 0.95rem; }
.sg-brief-cluster p { color: #9aa0a8; font-size: 0.84rem; margin: 0 0 8px; }
.sg-brief-cluster-kws { display: flex; flex-wrap: wrap; gap: 5px; }
.sg-brief-kw-chip {
  background: rgba(255,255,255,0.07);
  color: #d7d8dc;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.76rem;
}

.sg-brief-faq-item { border-left: 2px solid #d4af37; padding-left: 14px; margin-bottom: 14px; }
.sg-brief-faq-item strong { color: #e6e7ec; display: block; margin-bottom: 4px; font-size: 0.94rem; }
.sg-brief-faq-item span { color: #9aa0a8; font-size: 0.85rem; }

.sg-brief-outline { list-style: none; padding: 0; margin: 0; }
.sg-brief-outline > li { margin-bottom: 14px; }
.sg-brief-outline > li > strong {
  display: block;
  color: #f4d76a;
  font-size: 1rem;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(212,175,55,0.25);
}
.sg-brief-outline ul { margin: 6px 0 0 16px; }
.sg-brief-outline ul li { color: #b8c5d6; font-size: 0.88rem; margin-bottom: 3px; list-style: disc; }

.sg-brief-longtail { display: flex; flex-wrap: wrap; gap: 6px; }
.sg-brief-longtail span {
  background: rgba(123,231,214,0.1);
  color: #7be7d6;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.82rem;
  border: 1px solid rgba(123,231,214,0.2);
}

/* ── Raw JSON ── */
#sg-raw {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 18px;
  color: #b8c5d6;
  font-size: 0.82rem;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  max-height: 720px;
  overflow: auto;
  white-space: pre-wrap;
  margin: 0;
}

/* ── Responsive ── */
@media (max-width: 820px) {
  .sg-form-grid { grid-template-columns: 1fr 1fr; }
  .sg-modes { grid-column: 1 / -1; }
  #sg-mindmap { height: 560px; }
  .sg-results-header { flex-direction: column; align-items: stretch; }
  .sg-tabs, .sg-actions { justify-content: center; }
}
@media (max-width: 520px) {
  .sg-form-grid { grid-template-columns: 1fr; }
  .sg-header h1 { font-size: 1.6em; }
  .sg-form-card { padding: 18px; }
}

/* Related tools */
.sg-related {
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.sg-related h3 {
  font-size: 1em;
  color: #9aa0a8;
  margin: 0 0 16px;
  font-weight: 600;
}
.sg-related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sg-related-links a {
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  color: #9aa0a8;
  text-decoration: none;
  font-size: 0.88em;
  transition: border-color 0.15s, color 0.15s;
}
.sg-related-links a:hover { border-color: #d4af37; color: #d4af37; }
