/* ─── SEO BRIEFS ─────────────────────────────────────────────────────────── */

.seo-brief-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.seo-brief-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: stretch;
  padding: 16px;
  height: calc(100vh - 170px); /* hauteur fixe = viewport - topbar - marges */
  overflow: hidden;
}

.seo-brief-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.seo-brief-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.seo-brief-card-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text2);
  margin-bottom: 10px;
}

/* ─── SCORES ROW ─────────────────────────────────────────────────────────── */
.seo-brief-scores-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.seo-brief-score-card {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
}

.sbs-value {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

/* ─── TERMES ─────────────────────────────────────────────────────────────── */
.seo-brief-terms-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seo-brief-term {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  font-size: 11px;
  cursor: default;
  transition: background 0.15s, border-color 0.15s;
}

.sbt-name { color: var(--text); font-weight: 500; }
.sbt-count { font-weight: 700; font-size: 10px; }
.sbt-range {
  font-size: 9px;
  color: var(--text);
  background: var(--bg4);
  padding: 1px 4px;
  border-radius: 3px;
}
.sbt-max {
  font-size: 9px;
  color: var(--text);
  background: var(--bg4);
  padding: 1px 4px;
  border-radius: 3px;
}

.struct-name { color: var(--text); }
.struct-count { color: var(--text); }

/* ─── ÉDITEUR ────────────────────────────────────────────────────────────── */
.seo-brief-editor-wrap {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* crucial pour que flex fonctionne dans un parent flex */
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.seo-brief-toolbar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
}

.seo-brief-toolbar-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.seo-brief-toolbar-inner button {
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s;
}

.seo-brief-toolbar-inner button:hover {
  background: var(--bg4);
  border-color: var(--border);
}

.sbt-sep {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.seo-brief-editor-body {
  flex: 1;
  min-height: 0;
  padding: 20px 24px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.seo-brief-editor-body h1 { font-size: 1.6em; font-weight: 800; margin: 16px 0 8px; }
.seo-brief-editor-body h2 { font-size: 1.3em; font-weight: 700; margin: 14px 0 6px; }
.seo-brief-editor-body h3 { font-size: 1.1em; font-weight: 600; margin: 12px 0 4px; }
.seo-brief-editor-body h4 { font-size: 1em; font-weight: 700; margin: 10px 0 4px; }
.seo-brief-editor-body h5 { font-size: 0.9em; font-weight: 600; margin: 8px 0 3px; color: var(--text2); }
.seo-brief-editor-body h6 { font-size: 0.85em; font-weight: 600; margin: 6px 0 3px; color: var(--text3); }
.seo-brief-editor-body p  { margin: 0 0 10px; }
.seo-brief-editor-body ul,
.seo-brief-editor-body ol { margin: 0 0 10px; padding-left: 20px; }

/* ─── BRIEFS TABLE ───────────────────────────────────────────────────────── */
#seo-briefs-table td,
#seo-briefs-table th {
  white-space: nowrap;
  vertical-align: middle;
  padding: 10px 14px;
}

#seo-briefs-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}

#seo-briefs-table td {
  border-bottom: 1px solid var(--border);
}

#seo-briefs-table tr:hover td {
  background: var(--bg3);
}

#seo-briefs-table .link-monitor-row-actions {
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  gap: 4px;
}

#seo-briefs-table tr:hover .link-monitor-row-actions {
  opacity: 1;
}

/* ─── SUGGESTIONS ────────────────────────────────────────────────────────── */
.seo-brief-suggestion-mode {
  cursor: text;
  user-select: text;
}

.sug-insert {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  border-bottom: 2px solid #10b981;
  border-radius: 2px;
  cursor: pointer;
  padding: 0 1px;
}

.sug-old {
  background: rgba(239,68,68,0.15);
  color: #ef4444;
  text-decoration: line-through;
  border-radius: 2px;
  cursor: pointer;
  padding: 0 1px;
}

.sug-new {
  background: rgba(16,185,129,0.2);
  color: #10b981;
  border-bottom: 2px solid #10b981;
  border-radius: 2px;
  cursor: pointer;
  padding: 0 1px;
  margin-left: 2px;
}

.seo-brief-editor-body a { color: var(--accent); text-decoration: underline; }
.seo-brief-editor-body a:hover { opacity: 0.8; }