:root {
  color-scheme: light;
  --bg: #f7f7f4;
  --panel: #ffffff;
  --panel-muted: #fafaf8;
  --sidebar: #fbfbf8;
  --text: #1f2328;
  --muted: #6f7379;
  --subtle: #8c9097;
  --border: #e2e1dc;
  --border-strong: #c9c7bf;
  --primary: #2563eb;
  --primary-ink: #ffffff;
  --primary-soft: #eff5ff;
  --danger: #dc2626;
  --danger-soft: #fff1f1;
  --warning: #b45309;
  --warning-soft: #fff7ed;
  --success: #15803d;
  --success-soft: #effaf2;
  --shadow: 0 18px 50px rgba(27, 31, 35, 0.08);
  --radius: 8px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --surface: var(--panel);
  --soft: var(--panel-muted);
  --accent: var(--primary);
  --heading: var(--text);
  /* Infobulles : sombres en thème clair (convention), avec leur propre jeu de
     tokens pour rester lisibles quel que soit le fond de la page. */
  --tip-bg: #232936;
  --tip-text: #f4f4f5;
  --tip-muted: #a8adb8;
  --tip-border: transparent;
}

body.dark,
html.dark body {
  color-scheme: dark;
  --bg: #111214;
  --panel: #181a1d;
  --panel-muted: #15171a;
  --sidebar: #141619;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --subtle: #85858d;
  --border: #282b30;
  --border-strong: #3a3f46;
  --primary: #60a5fa;
  --primary-ink: #0b1220;
  --primary-soft: #142033;
  --danger: #f87171;
  --danger-soft: #2b1718;
  --warning: #fbbf24;
  --warning-soft: #2b2215;
  --success: #4ade80;
  --success-soft: #13251a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --surface: var(--panel);
  --soft: var(--panel-muted);
  --accent: var(--primary);
  --heading: var(--text);
  /* En thème sombre la bulle se détacherait mal du fond : on l'éclaircit
     légèrement et on lui ajoute une bordure. */
  --tip-bg: #262a31;
  --tip-text: #f4f4f5;
  --tip-muted: #a1a1aa;
  --tip-border: var(--border-strong);
}

/* L'attribut `hidden` doit toujours masquer. Sans cette règle, la moindre
   déclaration `display:` d'auteur (ex. `.dropzone { display: grid }`) bat le
   `[hidden] { display: none }` de la feuille du navigateur, et l'élément reste
   visible alors que le JS le croit masqué : c'est ce qui affichait la barre
   « Envoi en cours… » en même temps que la dropzone dès l'arrivée sur la page.
   Règle de normalisation standard, à garder avant tout le reste. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100dvh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100dvh;
  overflow: hidden;
  border-right: 1px solid var(--border);
  background: var(--sidebar);
  padding: 14px;
}

.sidebar-top,
.topbar,
.topbar-left,
.topbar-actions,
.button-row,
.modal-head,
.section-head,
.field-grid,
.form-footer,
.credits-row,
.history-item,
.user-card,
.entry-card,
.queued-row,
.bulk-head,
.pane-head,
.validation-row,
.public-header,
.switch-line,
.input-with-button {
  display: flex;
  align-items: center;
}

.sidebar-top {
  gap: 8px;
  /* un peu d'air entre le logo et le bouton « Lancer une analyse »
     (s'ajoute au gap:16px de .sidebar → ~24px au total) */
  margin-bottom: 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.brand:hover {
  text-decoration: none;
}

.brand strong,
.brand small,
.history-item strong,
.history-item small,
.user-card strong,
.user-card small,
.entry-card strong,
.entry-card small,
.queued-row strong,
.queued-row small {
  display: block;
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand strong {
  font-size: 14px;
}

.brand small,
.history-item small,
.user-card small,
.entry-card small,
.queued-row small {
  color: var(--muted);
  font-size: 12px;
}

.primary-action,
.nav-link,
.history-item,
.user-card {
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 12px;
  background: var(--text);
  color: var(--panel);
  font-weight: 650;
}

body.dark .primary-action {
  background: #f4f4f5;
  color: #111214;
}

.main-nav,
.sidebar-utility-nav {
  display: grid;
  gap: 2px;
}

.sidebar-utility-nav {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.nav-link {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  color: var(--muted);
}

.nav-link:hover,
.nav-link.is-active,
.history-item:hover,
.history-item.is-active,
.user-card:hover,
.credit-manage-button:hover {
  background: var(--panel);
  color: var(--text);
}

.nav-badge {
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 750;
  padding: 1px 6px;
}

.sidebar-section {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.history-list {
  display: grid;
  gap: 2px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-thumb {
  border: 2px solid var(--sidebar);
  border-radius: 999px;
  background: var(--border-strong);
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0;
  padding: 10px 10px 6px;
  text-transform: uppercase;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  padding: 0;
  text-transform: none;
  white-space: nowrap;
}

.history-item {
  gap: 8px;
  min-height: 44px;
  padding: 7px 10px;
}

.history-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.history-dot.danger {
  background: var(--danger);
}

.history-dot.success {
  background: var(--success);
}

.history-dot.warning {
  background: var(--warning);
}

.history-dot.neutral {
  background: var(--subtle);
}

.sidebar-footer {
  display: grid;
  /* minmax(0, …) : sans ça, un email long et insécable (ex. compte de test)
     gonfle la colonne au-delà de la largeur de la sidebar, et le bloc crédits
     déborde puis se fait rogner par overflow:hidden de la sidebar. */
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 0;
}

.credits-widget {
  display: grid;
  gap: 7px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  text-align: left;
}

.credits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.credit-manage-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-muted);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
}

.credit-manage-button svg {
  width: 14px;
  height: 14px;
}

.credits-row {
  justify-content: space-between;
  color: var(--muted);
}

.credits-row strong {
  color: var(--text);
}

.credit-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--border);
}

.credit-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--success));
}

.credits-meta {
  color: var(--subtle);
  font-size: 12px;
}

.user-card {
  gap: 9px;
  padding: 8px 10px;
}

.user-card > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

/* Nom + email : tronqués proprement plutôt que d'élargir la sidebar. */
.user-card > span:nth-child(2) strong,
.user-card > span:nth-child(2) small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.main {
  min-width: 0;
  padding-bottom: 56px;
}

body.auth-mode .app-shell {
  display: block;
}

body.auth-mode .sidebar,
body.auth-mode .topbar,
body.auth-mode .announcement,
body.auth-mode .support-fab {
  display: none;
}

body.auth-mode .main {
  min-height: 100dvh;
  padding-bottom: 0;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  justify-content: space-between;
  height: 58px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  padding: 0 28px;
  backdrop-filter: blur(16px);
}

.topbar-left,
.topbar-actions {
  gap: 10px;
}

.breadcrumbs {
  color: var(--muted);
  font-size: 13px;
}

.announcement {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 28px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  padding: 10px 12px;
}

.announcement span {
  min-width: 0;
  flex: 1;
}

.screen {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px;
}

.screen.is-active {
  display: block;
}

.screen.auth-screen {
  position: relative;
  max-width: none;
  min-height: 100dvh;
  padding: 96px 32px 32px;
}

.screen.auth-screen.is-active {
  display: grid;
  align-items: center;
  justify-items: center;
}

/* Pages larges et hautes (onboarding, forfaits) : ancrées en haut, pas
   centrées verticalement, sinon le haut du contenu déborde du viewport. */
.screen.auth-screen.is-active[data-page="choose-plan"],
.screen.auth-screen.is-active[data-page="onboarding-profile"] {
  align-items: start;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(280px, 420px);
  gap: 44px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.auth-shell.single {
  grid-template-columns: minmax(320px, 460px);
}

.auth-card,
.custom-plan-callout {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.auth-card {
  display: grid;
  gap: 16px;
  padding: 24px;
}

[data-page="login"] .auth-card,
[data-page="signup"] .auth-card {
  gap: 20px;
  padding: 28px;
}

[data-page="login"] .auth-head,
[data-page="signup"] .auth-head {
  margin-bottom: 2px;
}

[data-page="login"] .auth-divider,
[data-page="signup"] .auth-divider {
  margin: 2px 0;
}

[data-page="login"] .field,
[data-page="signup"] .field {
  gap: 8px;
}

[data-page="signup"] .field-grid.two {
  gap: 14px;
}

.auth-brand,
.auth-page-brand {
  width: fit-content;
  padding: 0;
  font-size: 16px;
  font-weight: 800;
}

.auth-page-brand {
  position: absolute;
  top: 32px;
  left: 32px;
}

.auth-head h1,
.auth-head p,
.custom-plan-callout h2,
.custom-plan-callout p,
.plan-billing {
  margin: 0;
}

.auth-head h1 {
  font-size: 30px;
  line-height: 1.1;
}

.auth-head p,
.auth-switch,
.plan-billing {
  color: var(--muted);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.auth-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  line-height: 1.2;
}

.auth-options input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.auth-switch {
  text-align: center;
}

.mail-provider-button {
  width: 100%;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-height: 50px;
  border: 1px solid #d7d9de;
  border-radius: 12px;
  background: #fff;
  color: #6f7175;
  cursor: pointer;
  font-family: "Roboto", "Inter", Arial, sans-serif;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: 0;
  line-height: 20px;
  padding: 0 18px;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.google-button:hover {
  border-color: #c5c8cf;
  background: #fafafa;
}

.google-button:active {
  background: #f5f5f5;
}

.google-button:focus-visible {
  outline: 2px solid #4285f4;
  outline-offset: 2px;
}

.google-logo {
  width: 21px;
  height: 21px;
  flex: 0 0 21px;
}

.auth-divider {
  position: relative;
  display: grid;
  place-items: center;
  color: var(--subtle);
  font-size: 12px;
}

.auth-divider::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  top: 50%;
  height: 1px;
  background: var(--border);
}

.auth-divider span {
  position: relative;
  background: var(--panel);
  padding: 0 10px;
}

.status-card {
  justify-items: start;
  text-align: left;
}

.status-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.status-icon.success {
  background: var(--success-soft);
  color: var(--success);
}

.plan-shell {
  display: grid;
  gap: 24px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.plan-topbar,
.custom-plan-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.plan-topbar {
  padding: 4px 0;
}

.billing-tabs {
  margin-bottom: 0;
}

.billing-only.is-hidden {
  display: none;
}

.custom-plan-callout {
  padding: 16px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-head.compact {
  margin-bottom: 18px;
}

.page-head.end {
  justify-content: flex-end;
}

.page-head h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: 0;
}

.page-head.compact h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.page-head .lead {
  max-width: 640px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.button,
.icon-button,
.segment,
.filter-chip,
.pill,
.dashed-button,
.tab {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-weight: 650;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
}

.button.secondary:hover,
.icon-button:hover,
.segment:hover,
.filter-chip:hover,
.pill:hover,
.tab:hover,
.dashed-button:hover {
  border-color: var(--border-strong);
  background: var(--panel-muted);
}

.button.danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
  background: var(--danger-soft);
  color: var(--danger);
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 36px;
  padding: 0;
}

.icon-button.small {
  width: 30px;
  height: 30px;
  min-height: 30px;
}

.danger-icon {
  color: var(--danger);
}

.button-row {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.entry-grid,
.pricing-grid,
.packs-grid,
.help-grid,
.diff-grid,
.field-grid.two,
.account-grid,
.result-layout {
  display: grid;
  gap: 14px;
}

.entry-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 26px;
}

.entry-card {
  gap: 12px;
  min-height: 86px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  padding: 16px;
  text-decoration: none;
}

.entry-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.entry-card > svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.entry-card > [data-lucide] svg {
  width: 22px;
  height: 22px;
  color: var(--primary);
}

.entry-card span {
  min-width: 0;
}

.section-head {
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0 12px;
}

.section-head.tight {
  margin: 0 0 12px;
}

.section-head h2,
.mini-panel h2,
.score-panel h2,
.form-panel h2,
.endpoint-card h2,
.diff-pane h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.section-head p {
  margin: 4px 0 0;
  color: var(--muted);
}

.table-card,
.form-panel,
.mini-panel,
.score-panel,
.diff-pane,
.endpoint-card,
.api-key-panel,
.price-card,
.pack-card,
.custom-pack,
.public-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.table-card {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: var(--panel-muted);
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: var(--panel-muted);
}

.align-right {
  text-align: right;
}

.table-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  text-align: left;
}

.chip,
.score-chip,
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  padding: 2px 9px;
  white-space: nowrap;
}

.chip.neutral,
.chip.muted {
  background: var(--panel-muted);
  color: var(--muted);
}

.chip.success,
.notice.success {
  background: var(--success-soft);
  color: var(--success);
}

.chip.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.chip.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.score-chip {
  min-width: 32px;
}

.score-chip.success {
  background: var(--success);
  color: #fff;
}

.score-chip.warning {
  background: var(--warning);
  color: #fff;
}

.score-chip.danger {
  background: var(--danger);
  color: #fff;
}

.filter-row,
.segments,
.pill-row,
.inline-checks,
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.compact-filter {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
}

.compact-filter span {
  color: var(--subtle);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.filter-chip,
.segment,
.pill,
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  color: var(--muted);
}

.history-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.history-summary > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
}

.history-summary span {
  color: var(--muted);
}

.history-summary strong {
  font-size: 18px;
}

.history-row.is-filtered-out {
  display: none;
}

.empty-filter-state {
  display: none;
  place-items: center;
  gap: 6px;
  margin-top: 14px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

.empty-filter-state.is-visible {
  display: grid;
}

.empty-filter-state svg {
  width: 28px;
  height: 28px;
  color: var(--subtle);
}

.empty-filter-state strong {
  color: var(--text);
}

.filter-chip.is-active,
.segment.is-active,
.pill.is-active,
.tab.is-active {
  border-color: var(--text);
  background: var(--text);
  color: var(--panel);
}

body.dark .filter-chip.is-active,
body.dark .segment.is-active,
body.dark .pill.is-active,
body.dark .tab.is-active {
  background: #f4f4f5;
  color: #111214;
}

.filter-chip span {
  color: inherit;
  opacity: 0.7;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

.single-column {
  max-width: 960px;
}

.form-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.field-grid.two,
.account-grid,
.result-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
}

.field > span,
.custom-pack > span {
  color: var(--text);
  font-weight: 700;
}

.field small {
  color: var(--muted);
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  padding: 9px 10px;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--primary) 25%, transparent);
  border-color: var(--primary);
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.toggle-card {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 12px;
  cursor: pointer;
}

.toggle-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.toggle-card:has(input:checked) {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
  background: var(--primary-soft);
}

.toggle-card span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--primary);
}

.toggle-card small {
  color: var(--muted);
}

.source-panel,
.tab-panel {
  display: none;
}

.source-panel.is-active,
.tab-panel.is-active {
  display: block;
}

.input-with-button {
  gap: 8px;
}

.input-with-button input {
  min-width: 0;
}

.dropzone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 190px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.dropzone.large {
  min-height: 240px;
}

.dropzone svg {
  width: 34px;
  height: 34px;
  color: var(--primary);
}

.dropzone strong {
  color: var(--text);
  font-size: 16px;
}

.form-footer {
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.cost-callout {
  display: grid;
  gap: 2px;
}

.cost-callout span,
.form-footer > span {
  color: var(--muted);
  font-size: 13px;
}

.context-panel,
.side-stack {
  display: grid;
  gap: 12px;
}

.context-panel {
  position: sticky;
  top: 82px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 16px;
}

.context-panel h2 {
  margin: 0;
  font-size: 15px;
}

.context-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.context-list div {
  display: flex;
  gap: 9px;
  color: var(--muted);
}

.queued-list,
.bulk-list,
.match-list,
.scan-history,
.endpoint-list,
.video-list,
.tour-steps {
  display: grid;
  gap: 10px;
}

.queued-row {
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.queued-row > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.notice,
.success-banner {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  color: var(--muted);
  padding: 12px;
}

.notice .button {
  margin-left: auto;
}

.bulk-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 12px;
}

.bulk-head {
  justify-content: space-between;
}

.bulk-item small {
  color: var(--muted);
}

.dashed-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border-style: dashed;
  color: var(--muted);
}

.inline-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.inline-checks input {
  width: auto;
}

.result-layout {
  margin-bottom: 14px;
}

.score-panel,
.plagiarism-panel {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
}

.score-panel {
  text-align: center;
}

.gauge {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, var(--panel) 0 56%, transparent 57%),
    conic-gradient(var(--score-color) var(--score), var(--border) 0);
}

.gauge span {
  color: var(--text);
  font-size: 42px;
  font-weight: 820;
  line-height: 1;
}

.source-editor {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

.mini-panel {
  padding: 14px;
}

.mini-panel p {
  margin: 8px 0;
  color: var(--muted);
}

.match-list div,
.scan-history > div {
  display: grid;
  gap: 2px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}

.scan-history-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.scan-history-row .scan-score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.scan-history-row .scan-credits {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.match-list small,
.scan-history span {
  color: var(--muted);
  font-size: 12px;
}

.plagiarism-state {
  display: grid;
  gap: 10px;
}

.plagiarism-state.is-hidden {
  display: none;
}

.plagiarism-empty {
  align-content: center;
  min-height: 150px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--panel-muted);
  padding: 14px;
}

.plagiarism-empty p {
  color: var(--text);
  font-weight: 750;
}

.source-editor {
  margin-top: 14px;
}

.source-editor .form-panel {
  margin-top: 14px;
  border: 0;
  padding: 0;
}

.scan-history-panel {
  margin-top: 14px;
}

.pipeline-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pipeline-strip span {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel-muted);
  color: var(--muted);
  padding: 8px 10px;
  text-align: center;
}

.pipeline-strip.done span,
.success-banner {
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.source-verdict,
.validation-row {
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
}

.diff-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}

.diff-pane {
  padding: 16px;
}

.diff-pane p {
  color: var(--muted);
}

del {
  border-radius: 3px;
  background: var(--danger-soft);
  color: var(--danger);
  text-decoration: none;
}

ins {
  border-radius: 3px;
  background: var(--success-soft);
  color: var(--success);
  text-decoration: none;
}

.validation-row {
  margin-top: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 12px;
}

.balance-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.balance-band > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

.balance-band span,
.balance-band small {
  color: var(--muted);
}

.balance-band strong {
  font-size: 28px;
}

/* ============================================================
   Forfaits (choose-plan + account/credit) — style repris des
   maquettes landing (toggle annuel/mensuel + cartes épurées)
   ============================================================ */
.pricing-block {
  display: grid;
  gap: 16px;
}

.prepaid-block {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.pricing-head {
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}

.pricing-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.15;
}

.pricing-head p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
}

.billing-toggle-area {
  display: grid;
  justify-items: center;
}

.billing-toggle {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.billing-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.billing-toggle button.is-active {
  background: var(--primary);
  color: #fff;
}

.billing-save {
  font-size: 11px;
  font-weight: 700;
}

.billing-toggle button:not(.is-active) .billing-save {
  color: var(--primary);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: min(100%, 980px);
  margin-inline: auto;
}

.pricing-grid[data-active-billing="annual"] [data-billing="monthly"],
.pricing-grid[data-active-billing="monthly"] [data-billing="annual"] {
  display: none;
}

.price-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 24px 22px 22px;
  border-radius: 16px;
}

.price-card.is-popular {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

/* Pill « Le plus populaire » à cheval sur le bord haut de la carte (hors flux
   → n'affecte plus l'alignement du contenu entre cartes). */
.price-badge {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 30%, transparent);
}

.price-card-head {
  display: grid;
  gap: 6px;
}

.price-card-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.15;
}

.price-credits {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Infobulle « À quoi correspond un crédit ? » (cartes d'abonnement)   *
 * Sans JS : :hover (souris) + :focus-within (clavier et tactile).     *
 * ------------------------------------------------------------------ */
.credit-info {
  position: relative;
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
}

.credit-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--primary) 40%, transparent);
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  cursor: help;
}

.credit-info-panel {
  position: absolute;
  z-index: 40;
  top: 50%;
  left: calc(100% + 12px);
  transform: translateY(-50%);
  display: grid;
  gap: 8px;
  width: max-content;
  max-width: 320px;
  padding: 14px 16px;
  border: 1px solid var(--tip-border, transparent);
  border-radius: 10px;
  background: var(--tip-bg);
  color: var(--tip-text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease;
  text-align: left;
  white-space: normal;
}

.credit-info:hover .credit-info-panel,
.credit-info:focus-within .credit-info-panel {
  opacity: 1;
  visibility: visible;
}

/* Flèche pointant vers le déclencheur. */
.credit-info-panel::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -5px;
  width: 10px;
  height: 10px;
  transform: translateY(-50%) rotate(45deg);
  border-left: 1px solid var(--tip-border, transparent);
  border-bottom: 1px solid var(--tip-border, transparent);
  background: var(--tip-bg);
}

.credit-info-title {
  color: var(--tip-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.credit-info-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  font-size: 13.5px;
  font-weight: 400;
}

.credit-info-row strong {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.credit-info-foot {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--tip-text) 16%, transparent);
  color: var(--tip-muted);
  font-size: 12px;
  font-weight: 400;
}

/* Sous 1180px les cartes se resserrent : la bulle passe SOUS le déclencheur
   pour ne pas sortir de l'écran. */
@media (max-width: 1180px) {
  .credit-info-panel {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    max-width: min(320px, 78vw);
  }
  .credit-info-panel::before {
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    border-left: 1px solid var(--tip-border, transparent);
    border-bottom: 0;
    border-top: 1px solid var(--tip-border, transparent);
  }
}

.price-block {
  display: grid;
  gap: 4px;
}

.price-amount {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-billed {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.3;
}

.price-value {
  font-size: 40px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.price-period {
  color: var(--muted);
  font-size: 14px;
}

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

.price-features li {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.35;
}

.price-features li::before {
  content: "✓";
  color: var(--success);
  font-size: 12px;
  font-weight: 700;
}

/* Fonctionnalité non incluse dans ce forfait : grisée + barrée. */
.price-features li.is-unavailable {
  color: var(--subtle);
  text-decoration: line-through;
}

.price-features li.is-unavailable::before {
  content: "–";
  color: var(--subtle);
  text-decoration: none;
}

.price-card form {
  display: grid;
  margin: 0;
  margin-top: auto;
}

.price-cta {
  width: 100%;
}

/* Sur la carte blanche, les CTA non-populaires doivent rester lisibles comme
   des boutons (contour marqué) plutôt que du texte flottant. */
.price-cta.secondary,
.pack-card .button.secondary {
  background: var(--surface);
  border-color: var(--border-strong);
}

.price-cta.secondary:hover,
.pack-card .button.secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pack-card,
.custom-pack {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 16px;
}

.pack-card strong,
.pack-card span {
  margin: 0;
}

.packs-grid {
  grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr));
  width: min(100%, 980px);
  margin-inline: auto;
}

/* Bloc « Montant personnalisé » : champ + unité + aide + CTA empilés proprement. */
.custom-pack form {
  display: grid;
  gap: 10px;
  justify-items: start;
}

.custom-pack-input {
  display: flex;
  align-items: center;
  gap: 8px;
}

.custom-pack-input input {
  width: 80px;
  max-width: 80px;
  text-align: right;
}

.custom-pack-input span {
  color: var(--muted);
  font-weight: 600;
}

.custom-pack small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.custom-pack .button {
  width: auto;
}

.account-grid {
  align-items: start;
}

.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
}

.search-field {
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 680px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 9px 12px;
}

.search-field input {
  border: 0;
  padding: 0;
}

.help-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.video-list button {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  padding: 12px;
  text-align: left;
}

.video-list span {
  color: var(--muted);
  font-size: 12px;
}

.api-key-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px;
}

.api-key-panel span {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

code,
pre {
  font-family: var(--mono);
}

code {
  border-radius: 4px;
  background: var(--panel-muted);
  padding: 2px 5px;
}

.endpoint-card {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.endpoint-card p {
  margin: 0;
  color: var(--muted);
}

pre {
  overflow: auto;
  margin: 0;
  border-radius: 6px;
  background: #101114;
  color: #f4f4f5;
  padding: 14px;
}

.method {
  width: fit-content;
  background: var(--success-soft);
  color: var(--success);
}

.public-report {
  max-width: 980px;
}

.public-header {
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--muted);
}

.public-card {
  padding: 22px;
}

.support-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--text);
  color: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
}

body.public-mode .sidebar,
body.public-mode .topbar,
body.public-mode .announcement,
body.public-mode .support-fab {
  display: none;
}

body.public-mode .app-shell {
  display: block;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  background: rgba(12, 13, 15, 0.48);
}

.modal-backdrop.is-open {
  display: block;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.is-open {
  display: flex;
}

.modal-card {
  width: min(100%, 560px);
  max-height: min(760px, calc(100dvh - 36px));
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
}

.modal-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.switch-line {
  gap: 8px;
  margin-bottom: 12px;
}

.switch-line input {
  width: auto;
}

.tour-steps div {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}

.tour-steps strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
}

.mobile-only {
  display: none;
}

.sidebar-scrim {
  display: none;
}

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

  .context-panel {
    position: static;
  }

  .packs-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}

@media (max-width: 920px) {
  .app-shell {
    display: block;
  }

  .mobile-only {
    display: inline-grid;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    transform: translateX(-100%);
    width: min(292px, calc(100vw - 44px));
    transition: transform 160ms ease;
    box-shadow: var(--shadow);
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-scrim {
    position: fixed;
    inset: 0;
    z-index: 75;
    background: rgba(12, 13, 15, 0.42);
  }

  body.sidebar-open .sidebar-scrim {
    display: block;
  }

  .topbar {
    padding: 0 16px;
  }

  .announcement,
  .screen {
    margin-left: 16px;
    margin-right: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  .page-head,
  .api-key-panel {
    display: grid;
  }

  .entry-grid,
  .field-grid.two,
  .toggle-grid,
  .result-layout,
  .diff-grid,
  .auth-shell,
  .balance-band,
  .account-grid,
  .help-grid,
  .history-summary {
    grid-template-columns: 1fr;
  }

  .plan-topbar,
  .custom-plan-callout {
    display: grid;
  }

  .button-row,
  .form-footer,
  .api-key-panel .button-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 13px;
  }

  .topbar-actions .button span {
    display: none;
  }

  .announcement {
    align-items: flex-start;
  }

  .screen.auth-screen {
    padding: 84px 18px 18px;
  }

  .auth-page-brand {
    top: 18px;
    left: 18px;
  }

  .auth-card {
    padding: 18px;
  }

  [data-page="login"] .auth-card,
  [data-page="signup"] .auth-card {
    gap: 18px;
    padding: 20px;
  }

  .button,
  .entry-card,
  .queued-row,
  .input-with-button,
  .modal-actions {
    width: 100%;
  }

  .button-row,
  .input-with-button,
  .queued-row,
  .form-footer,
  .modal-actions {
    display: grid;
  }

  .pipeline-strip {
    grid-template-columns: 1fr;
  }

  .public-header {
    display: grid;
    gap: 10px;
  }
}
/* additions laravel */
[data-lucide] svg {
  width: 1.15em;
  height: 1.15em;
  display: block;
}

.v2-shell {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.v2-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 292px;
  padding: 14px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform .2s ease;
  overflow-y: auto;
}

.v2-sidebar > .brand {
  display: flex;
  margin-bottom: 22px;
}

.v2-sidebar-open .v2-sidebar {
  transform: translateX(0);
}

.v2-main {
  min-height: 100vh;
}

.v2-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 18px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.v2-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.brand-lockup,
.nav-item,
.recent-item,
.credit-widget,
.topbar-actions,
.inline-actions,
.stat-strip,
.analysis-options,
.form-row,
.choice-row,
.plan-price,
.auth-links {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 10px;
  margin-bottom: 22px;
  font-weight: 800;
  color: var(--heading);
}

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

.nav-item {
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
}

.nav-item:hover,
.nav-item.active {
  color: var(--heading);
  background: var(--soft);
}

.credit-widget,
.recent-panel,
.panel,
.auth-panel,
.modal-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
}

.credit-widget {
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 22px;
}

.credit-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--heading);
}

.recent-panel {
  padding: 14px;
}

.recent-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.recent-item {
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: var(--text);
  text-decoration: none;
  border-top: 1px solid var(--border);
}

.recent-item:first-child {
  border-top: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.page-title,
.auth-title {
  margin: 0;
  color: var(--heading);
  letter-spacing: 0;
}

.page-title {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}

.page-subtitle,
.muted,
.field-hint {
  color: var(--muted);
}

.grid-3,
.project-grid,
.plans-grid {
  display: grid;
  gap: 16px;
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-grid,
.plans-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.panel {
  padding: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.metric {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--heading);
}

.button,
.button-primary,
.button-secondary,
.button-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #fff;
}

.button-secondary {
  background: var(--soft);
  color: var(--heading);
  border-color: var(--border);
}

.button-ghost {
  color: var(--text);
  background: transparent;
  border-color: var(--border);
}

.button:disabled,
.button-primary:disabled {
  opacity: .6;
  cursor: wait;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.v2-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.v2-table th,
.v2-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.v2-table th {
  color: var(--muted);
  font-size: .78rem;
  text-transform: uppercase;
}

.status-chip,
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 750;
  background: var(--soft);
  color: var(--heading);
}

/* Puce de chargement (point animé + libellé) : un peu plus d'air autour. */
.status-chip:has(.spinner-dot) {
  padding: 2px 12px;
}

.status-chip .spinner-dot {
  flex-shrink: 0;
}

.score-good { background: color-mix(in srgb, #16a34a 16%, var(--surface)); color: #15803d; }
.score-mid { background: color-mix(in srgb, #f59e0b 18%, var(--surface)); color: #b45309; }
.score-low { background: color-mix(in srgb, #ef4444 16%, var(--surface)); color: #dc2626; }

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: var(--bg);
}

.auth-panel {
  width: min(100%, 480px);
  padding: 28px;
}

.auth-shell.auth-wide {
  grid-template-columns: minmax(320px, 1050px);
}

.auth-wide {
  width: min(100%, 1050px);
}

.auth-card.auth-wide {
  width: min(100%, 1050px);
}

.auth-shell.auth-medium {
  grid-template-columns: minmax(320px, 780px);
}

.auth-card.auth-medium {
  width: min(100%, 780px);
}

.auth-card .page-header {
  margin-bottom: 0;
}

.auth-options {
  flex-wrap: wrap;
}

.auth-options a.text-link {
  margin-left: auto;
  line-height: 1.2;
}

.auth-options input[type="checkbox"],
.choice-row input[type="checkbox"] {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.auth-switch {
  margin: 0;
}

.choice-row {
  gap: 8px;
  line-height: 1.35;
}

/* Contrôles de formulaire uniquement : `.field` est aussi le wrapper de
   groupe de champ dans l'app (label.field/div.field) — ne pas le border. */
input.field,
select.select,
textarea.textarea {
  width: 100%;
  border: 1px solid var(--border);
  /* background-color (pas le raccourci `background`) : le raccourci réinitialise
     background-repeat/position/size et faisait carreler le chevron custom du
     select global (mosaïque de chevrons sur les pages bulk). */
  background-color: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

.textarea {
  min-height: 280px;
  resize: vertical;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--heading);
  font-weight: 750;
}

.form-grid {
  display: grid;
  gap: 15px;
}

.form-row {
  gap: 12px;
}

.form-error,
.validation-errors {
  color: #dc2626;
}

.alert {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--soft);
}

.alert-success {
  color: #15803d;
}

.analysis-options {
  align-items: stretch;
  gap: 12px;
  flex-wrap: wrap;
}

.choice-card {
  flex: 1 1 230px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.modal.is-open {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, .42);
}

.modal-panel {
  width: min(100%, 560px);
  padding: 24px;
}

.modal-panel-large {
  width: min(100%, 960px);
  max-height: min(860px, calc(100vh - 32px));
  overflow: auto;
}

.bulk-page-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, 1fr);
  gap: 16px;
}

.file-preview {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--soft);
}

.thumbnail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  align-content: start;
}

.page-thumb {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}

.page-thumb img {
  width: 100%;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.pagination {
  margin-top: 18px;
}

.pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pager-summary {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.pager-summary-muted {
  color: var(--muted);
  font-weight: 500;
}

.pager-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager-list li {
  margin: 0;
}

.pager-link {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

a.pager-link:hover {
  border-color: var(--border-strong);
  background: var(--panel-muted);
}

.pager-link.is-active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-ink);
  cursor: default;
}

.pager-link.is-disabled {
  color: var(--subtle);
  background: var(--panel-muted);
  cursor: not-allowed;
}

.pager-link i,
.pager-link svg {
  width: 16px;
  height: 16px;
}

.pager-ellipsis {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 34px;
  color: var(--subtle);
  font-size: 13px;
}

@media (min-width: 1040px) {
  .v2-sidebar {
    transform: none;
  }

  .v2-main {
    margin-left: 292px;
  }

  [data-sidebar-toggle] {
    display: none;
  }
}

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

  .section-head,
  .page-header,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head .form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .section-head .field {
    min-width: 0;
  }

  .topbar-actions {
    gap: 8px;
  }

  .bulk-page-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .section-head .form-row {
    grid-template-columns: 1fr;
  }
}


/* Correctifs cascade (2026-07-07) : les ajouts tardifs ne doivent pas
   réafficher les éléments mobile-only sur desktop. */
.mobile-only {
  display: none;
}

@media (max-width: 920px) {
  .mobile-only {
    display: inline-flex;
  }
}


/* Toasts (feedback utilisateur, 2026-07-07) */
.toast-stack {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(380px, calc(100vw - 36px));
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-left-width: 4px;
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  animation: toast-in 0.18s ease-out;
}

.toast svg {
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast.success { border-left-color: var(--success); }
.toast.success svg { color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error svg { color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning svg { color: var(--warning); }
.toast.info { border-left-color: var(--primary); }
.toast.info svg { color: var(--primary); }

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
}

/* Erreurs de champ */
.field-error {
  color: var(--danger);
  font-size: 12px;
  margin: 6px 0 0;
}

.field.is-invalid,
input.is-invalid,
select.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
}

/* ============================================================
   Logo landing (2026-07-07) : sparkles nu + wordmark très gras,
   comme lucide-homepage-md-5-variations.html
   ============================================================ */
.brand {
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

/* ============================================================
   Logo de marque (2026-07-17) : <x-brand-logo />, SVG vectorisé.
   Remplace le lockup « sparkles + wordmark texte ». L'encre est en
   currentColor et .brand pose color: var(--text) -> le logo s'inverse
   tout seul en thème sombre. Seule la hauteur est pilotée, la largeur
   suit le ratio du viewBox (162x28 pour le complet, carré pour l'icône).
   ============================================================ */
.brand-logo {
  display: block;
  width: auto;
  flex: none;
}

.brand-logo-full {
  height: 28.8px; /* -10% vs 32px (retour Thomas : encore un poil trop grand dans l'app) */
}

.brand-logo-icon {
  height: 28px;
  width: 28px;
}

.auth-page-brand .brand-logo-full {
  height: 34px;
}

/* ============================================================
   Analyses récentes (sidebar) : version allégée une ligne
   ============================================================ */
.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
}

.history-item:hover {
  background: var(--panel-muted);
  color: var(--text);
  text-decoration: none;
}

.history-item .history-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
}

.history-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 450;
}

.history-meta {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

/* Badge « Test » de l'analyse de démonstration offerte à l'inscription.
   .history-title porte déjà flex:1 + ellipsis : c'est le titre qui se tronque,
   le badge et le score restent toujours visibles. */
.history-tag {
  flex: 0 0 auto;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
}

/* Liens de la sidebar : jamais bleus, jamais soulignés */
.sidebar a {
  text-decoration: none;
}

.sidebar a:hover {
  text-decoration: none;
}

.user-card {
  color: var(--text);
}

.user-card strong {
  color: var(--text);
}

/* Page API : détails des cartes endpoint (2026-07-07) */
.endpoint-card h3 {
  margin: 6px 0 0;
  font-size: 13px;
}

.endpoint-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 4px;
}

.endpoint-card code {
  font-family: var(--mono);
  font-size: 12px;
}

.input-with-button form {
  display: contents;
}

/* Fix : code à l'intérieur d'un pre = pas de fond/padding propre (2026-07-07) */
pre code {
  background: transparent;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  white-space: pre;
}

/* Rapport public : grille de métriques (2026-07-07) */
.report-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}
.report-metrics .panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 18px;
}

/* Pages d'erreur (2026-07-07) */
.error-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  gap: 24px;
  grid-template-rows: auto auto 1fr;
  padding: 40px 20px;
  background: var(--bg);
  color: var(--text);
}

.error-screen .brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.error-card {
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 40px 32px;
}

.error-code {
  margin: 0;
  font-size: 56px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--subtle);
  font-variant-numeric: tabular-nums;
}

.error-card h1 {
  margin: 0;
  font-size: 22px;
}

.error-card p {
  margin: 0;
  color: var(--muted);
}

/* Analyses récentes : lignes plus compactes + hover visible en light (2026-07-08) */
:root { --hover: #ecebe4; --active: #e3e1d6; }
body.dark, html.dark body { --hover: #1e2126; --active: #2a2e35; }

.history-item {
  min-height: 30px;
  padding: 4px 8px;
}

.history-item:hover {
  background: var(--hover);
  color: var(--text);
}

/* Analyse en cours de consultation : fond + texte qui tranchent (2026-07-16) */
.history-item.is-active,
.history-item.is-active:hover {
  background: var(--active);
  color: var(--text);
}

.history-item.is-active .history-title {
  font-weight: 600;
  color: var(--text);
}

.history-item.is-active .history-meta {
  color: var(--muted);
}

/* ============================================================
   Tour guidé interactif (spotlight) — 2026-07-08
   ============================================================ */
.button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.button.ghost:hover {
  background: var(--panel-muted);
  color: var(--text);
}

.tour-guard {
  position: fixed;
  inset: 0;
  z-index: 88;
  cursor: default;
}

.tour-cutout {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 90;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(15, 17, 20, 0.55);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  pointer-events: none;
  transition: top 0.18s ease, left 0.18s ease, width 0.18s ease, height 0.18s ease;
}

.tour-pop {
  position: fixed;
  z-index: 92;
  width: min(340px, calc(100vw - 24px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
  transition: top 0.18s ease, left 0.18s ease;
}

.tour-pop-progress {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.tour-pop h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.tour-pop p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.tour-pop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 8px;
  margin-top: 16px;
}

.tour-pop-nav {
  display: flex;
  gap: 8px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tour-pop-nav .button {
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}

.tour-pop [data-tour-skip] {
  font-weight: 500;
}

@media (max-width: 720px) {
  .tour-pop-actions {
    flex-wrap: wrap;
  }
  .tour-pop-nav {
    flex: 1;
    justify-content: flex-end;
  }
}

/* ============================================================
   Centre d'aide — 2026-07-08
   ============================================================ */
.help-search {
  margin: 4px 0 8px;
}

.score-bands {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.score-band {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}

.score-band .score-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.score-band .score-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: none;
}
.score-band .score-dot.danger { background: var(--danger); }
.score-band .score-dot.warning { background: var(--warning, #d08a1d); }
.score-band .score-dot.success { background: var(--success, #2f9e57); }

.score-band h3 {
  margin: 8px 0 4px;
  font-size: 14px;
}

.score-band p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.faq-group {
  margin-top: 30px;
}

.faq-group > .eyebrow {
  margin-bottom: 2px;
}

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::after {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  flex: none;
}

.faq-item[open] > summary::after {
  transform: rotate(-135deg);
}

.faq-item > summary:hover {
  background: var(--panel-muted);
}

.faq-answer {
  padding: 2px 18px 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.65;
}

.faq-answer p { margin: 0 0 8px; }
.faq-answer p:last-child { margin-bottom: 0; }
.faq-answer code {
  background: var(--panel-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12.5px;
}
.faq-answer a { color: var(--primary); }

.help-empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 640px) {
  .score-bands {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Menu utilisateur sidebar (Mon compte / Déconnexion) — 2026-07-08
   ============================================================ */
.user-menu {
  position: relative;
}

.user-card > i,
.user-card > svg {
  transition: transform 0.15s ease;
}

.user-card[aria-expanded="true"] > i,
.user-card[aria-expanded="true"] > svg {
  transform: rotate(180deg);
}

.user-menu-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 6px;
  display: grid;
  gap: 2px;
}

.user-menu-pop[hidden] {
  display: none;
}

.user-menu-pop form {
  margin: 0;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-align: left;
  cursor: pointer;
}

.user-menu-item:hover {
  background: var(--panel-muted);
}

.user-menu-item > i,
.user-menu-item > svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
  flex: none;
}

/* ============================================================
   Select : chevron custom espacé du bord (fix global) — 2026-07-08
   ============================================================ */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236f7379' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}

body.dark select,
html.dark body select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ============================================================
   Onboarding — choix du profil (cartes radio) — 2026-07-08
   ============================================================ */
.type-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-width: 720px;
  margin-inline: auto;
}

.type-card {
  position: relative;
  display: flex;
  flex: 1 1 210px;
  max-width: 232px;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.type-card:hover {
  border-color: var(--border-strong);
}

.type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-card:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.type-card:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.type-card-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.type-card-icon svg {
  width: 18px;
  height: 18px;
}

.type-card-label {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.type-details.is-hidden {
  display: none;
}

.auth-head.centered {
  text-align: center;
  max-width: 560px;
  margin-inline: auto;
}

/* Vérification d'email : actions centrées, empilées, largeur homogène. */
.verify-actions {
  margin-top: 10px;
  justify-items: center;
}

.verify-actions form {
  display: grid;
  width: 100%;
}

.verify-actions .button {
  width: 100%;
  justify-content: center;
}

/* ============================================================
   Correctifs recette staging — 2026-07-09
   ============================================================ */

/* 1. Accusé de vérification d'email au-dessus de l'onboarding. */
.onboarding-verified {
  align-items: center;
  margin-bottom: 18px;
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
}

/* 6. Bouton « Générer ma clé API » à l'intérieur de l'encart. */
.notice-action {
  align-items: center;
  flex-wrap: wrap;
  row-gap: 10px;
}

.notice-action form {
  margin-left: auto;
}

/* 3. Réassurance /choose-plan : compteurs + logos adaptés au profil. */
.reassurance {
  display: grid;
  gap: 18px;
  width: min(100%, 980px);
  margin: 0 auto 24px;
  text-align: center;
}

.reassurance-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.reassurance-stat {
  display: grid;
  gap: 3px;
  min-width: 132px;
  padding: 12px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.reassurance-stat strong {
  font-size: 24px;
  font-weight: 820;
  line-height: 1;
  color: var(--text);
}

.reassurance-stat span {
  font-size: 12.5px;
  color: var(--muted);
}

.reassurance-stat sup {
  font-size: 0.7em;
}

.reassurance-logos-title {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}

.logo-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.logo-strip .logo-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.logo-strip img {
  height: 26px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: 0.72;
}

.reassurance-note {
  margin: 0;
  font-size: 11px;
  color: var(--subtle);
}

/* 8. Panneau plagiat harmonisé avec le panneau de score IA. */
.plagiarism-orb {
  display: grid;
  place-items: center;
  width: 132px;
  height: 132px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
}

.plagiarism-orb .orb-value {
  font-size: 40px;
  font-weight: 820;
  line-height: 1;
  color: inherit;
}

.plagiarism-orb .orb-value small {
  font-size: 20px;
  font-weight: 750;
}

.plagiarism-orb svg,
.plagiarism-orb [data-lucide] svg {
  width: 46px;
  height: 46px;
}

.plagiarism-orb.is-good {
  background: var(--success-soft);
  color: var(--success);
}

.plagiarism-orb.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.plagiarism-orb.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.plagiarism-panel .match-list {
  margin-top: 4px;
  text-align: left;
}

/* ------------------------------------------------------------------ *
 * /choose-plan : 4 cartes alignées (3 abonnements + 1 carte crédits)  *
 * Défini APRÈS .pricing-grid pour gagner la cascade sur ce layout.    *
 * ------------------------------------------------------------------ */
.pricing-grid--credits {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: min(100%, 1180px);
}

/* Tablette : 2×2. Ces règles suivent le @media 860px existant de */
/* .pricing-grid, donc elles gagnent la cascade pour --credits.   */
@media (max-width: 1180px) {
  .pricing-grid--credits {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 680px);
  }
}

@media (max-width: 620px) {
  .pricing-grid--credits {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 420px;
  }
}

/* Carte crédits = option SECONDAIRE : fond recessed (= fond de page),
   accents muets (pas de bleu), prix discret. Le CTA reste blanc/secondaire
   (défini par .price-cta.secondary), face aux CTA bleus des abonnements. */
.credit-card {
  background: var(--bg);
  border-color: var(--border);
}

.credit-card h3 {
  color: var(--muted);
  font-size: 17px;
}

.credit-card .price-credits {
  color: var(--muted);
}

.credit-card .price-value {
  color: var(--muted);
  font-size: 30px;
}

.credit-select-field {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.credit-select-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background-color: var(--surface);
  color: var(--heading);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}

.credit-select-field select:hover {
  border-color: var(--primary);
}

.credit-select-field select:focus-visible {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}

/* /choose-plan : pas de "carte" blanche autour du contenu — les plans
   s'affichent directement sur le fond de page. On élargit un peu le conteneur
   pour laisser respirer la grille à 4 colonnes. Défini après .auth-card.auth-wide
   pour gagner la cascade (spécificité égale). Scopé à cette page uniquement. */
.screen.auth-screen[data-page="choose-plan"] .auth-shell.auth-wide {
  grid-template-columns: minmax(320px, 1200px);
}

[data-page="choose-plan"] .auth-card {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  width: min(100%, 1200px);
}

/* Remonter le bloc titre → toggle SANS bouger les cartes : on réduit le
   padding-top (ce qui remonte tout), puis on compense par un margin-top sur la
   grille pour que les cartes gardent leur position. Le logo (absolute top:32px)
   et le bandeau (fixed en bas) ne bougent pas non plus. */
.screen.auth-screen[data-page="choose-plan"] {
  padding-top: 32px;
  padding-bottom: 116px;
}

[data-page="choose-plan"] .pricing-grid {
  margin-top: 16px;
}

/* « Faites confiance à Lucide » → bandeau STICKY pleine largeur, collé en bas
   de l'écran (toujours visible sans scroll). Layout horizontal compact. */
[data-page="choose-plan"] .reassurance {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 44px);
  flex-wrap: wrap;
  background: var(--panel);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 24px rgba(17, 18, 20, 0.06);
}

/* Note (substantiation du « N°1 ») masquée dans le bandeau compact. */
[data-page="choose-plan"] .reassurance-note {
  display: none;
}

/* Stats aplaties en texte inline (pas de mini-cartes), centrées verticalement. */
[data-page="choose-plan"] .reassurance-stats {
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(14px, 2vw, 30px);
}

[data-page="choose-plan"] .reassurance-stat {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
  white-space: nowrap;
}

[data-page="choose-plan"] .reassurance-stat strong {
  font-size: 18px;
}

[data-page="choose-plan"] .reassurance-stat span {
  font-size: 12.5px;
}

/* Logos : sous-titre profilé masqué, strip compact. */
[data-page="choose-plan"] .reassurance-logos {
  display: flex;
  align-items: center;
}

[data-page="choose-plan"] .reassurance-logos-title {
  display: none;
}

[data-page="choose-plan"] .logo-strip {
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(14px, 2vw, 26px);
}

/* Logos nus : sans bordure ni fond. */
[data-page="choose-plan"] .logo-strip .logo-cell {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 0;
}

[data-page="choose-plan"] .logo-strip img {
  height: 24px;
}

/* Mobile : un bandeau horizontal ne tient pas → on repasse la réassurance en
   flux normal, look d'origine (mini-cartes + logos empilés). */
@media (max-width: 620px) {
  .screen.auth-screen[data-page="choose-plan"] {
    padding-bottom: 18px;
  }
  [data-page="choose-plan"] .reassurance {
    position: static;
    width: min(100%, 980px);
    margin: 28px auto 24px;
    padding: 0;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 18px;
    text-align: center;
    background: transparent;
    border-top: 0;
    box-shadow: none;
  }
  [data-page="choose-plan"] .reassurance-note { display: block; }
  [data-page="choose-plan"] .reassurance-logos-title { display: block; }
  [data-page="choose-plan"] .reassurance-stats { flex-wrap: wrap; }
  [data-page="choose-plan"] .reassurance-stat {
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 132px;
    padding: 12px 20px;
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: var(--radius);
  }
  [data-page="choose-plan"] .reassurance-stat strong { font-size: 24px; }
  [data-page="choose-plan"] .logo-strip { flex-wrap: wrap; }
}

/* ------------------------------------------------------------------ *
 * /account/credit : bloc dédié « Ajouter des crédits » + forfait courant
 * ------------------------------------------------------------------ */

/* Entrée d'accueil pointant vers une fonctionnalité non incluse : visible mais
   visiblement inactive, et elle mène aux formules (pas à un 403). */
.entry-card.is-locked {
  border-style: dashed;
  color: var(--muted);
}

.entry-card.is-locked strong {
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Bandeau d'offre ponctuelle : Pass 30 jours ou recharge (Pricing V2) *
 * Placé SOUS les 3 cartes d'abonnement, dont il couvre la largeur      *
 * combinée : .pricing-grid et .credit-block partagent width:           *
 * min(100%, 980px) + centrage, donc l'alignement suit sans largeur     *
 * en dur. Deux zones séparées par un filet : l'offre à gauche,         *
 * l'achat à droite. Hérite de .credit-block pour le cadre.             *
 * ------------------------------------------------------------------ */
/* Sélecteur à DEUX classes : `.credit-block` est déclaré plus bas dans ce
   fichier, donc à spécificité égale il gagnerait la cascade et réimposerait
   son align-items:center / gap / padding — ce qui recentrait verticalement la
   colonne de gauche au lieu de l'aligner en haut. */
.credit-block.offer-band {
  align-items: stretch;
  gap: 0;
  margin-top: 18px;
  margin-bottom: 0;
  padding: 24px 28px;
}

.offer-band-main {
  flex: 1 1 380px;
  min-width: 0;
  padding-right: 28px;
}

.offer-band-head h2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.2;
}

/* Pastille « Sans abonnement » : inline, contrairement à .price-badge qui est
   positionné en absolu sur le haut des cartes. */
.pass-tag {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.offer-band-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.4;
}

/* Mêmes coches que les cartes d'abonnement (.price-features), sur 2 colonnes.
   Défini APRÈS .price-features pour gagner la cascade. */
.offer-band-features {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 24px;
}

/* align-content:start -> la colonne d'achat démarre en haut, au même niveau que
   le titre à gauche (le filet, lui, reste pleine hauteur grâce au stretch). */
.offer-band-buy {
  flex: 0 0 auto;
  display: grid;
  align-content: start;
  gap: 12px;
  width: min(100%, 264px);
  padding-left: 28px;
  border-left: 1px solid var(--border);
}

.offer-band-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.offer-band-price .price-value {
  font-size: 32px;
  font-weight: 650;
  line-height: 1;
  color: var(--heading);
}

/* Mentions secondaires (« paiement unique », prix au crédit) : graisse normale
   et teinte claire, pour ne pas concurrencer le prix ni le CTA. */
.offer-band-period {
  color: var(--subtle);
  font-size: 13px;
  font-weight: 400;
}

.offer-band-buy form {
  margin: 0;
  display: grid;
}

.offer-band-note {
  margin: 0;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 400;
  text-align: center;
}

/* Le CTA porte en permanence l'aspect que .button.secondary ne prenait qu'au
   survol (fond teinté + bordure marquée) ; le survol pousse alors d'un cran.
   Teintes dérivées des tokens, pas de couleur en dur. */
.offer-band-buy .button.secondary {
  min-height: 42px;
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--border) 40%, var(--panel));
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.offer-band-buy .button.secondary:hover {
  border-color: var(--border-strong);
  background: color-mix(in srgb, var(--border) 70%, var(--panel));
}

/* Empilé : le filet vertical devient une séparation horizontale. */
@media (max-width: 860px) {
  .credit-block.offer-band {
    flex-direction: column;
    padding: 20px;
    /* La grille passe à une colonne de 420px max : le bandeau s'aligne dessus,
       sinon il déborderait en largeur sous des cartes devenues étroites. */
    max-width: 420px;
  }
  /* En colonne, le flex-basis porte sur la HAUTEUR : sans ce reset, le
     `flex: 1 1 380px` de la vue large imposait 380px de haut à la zone de
     gauche et creusait un grand vide au-dessus du séparateur. */
  .offer-band-main {
    flex: 0 1 auto;
    padding-right: 0;
  }
  .offer-band-buy {
    width: 100%;
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 620px) {
  .offer-band-features {
    grid-template-columns: 1fr;
  }
}

/* Bloc horizontal d'ajout de crédits, au-dessus des abonnements. */
.credit-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px 28px;
  flex-wrap: wrap;
  width: min(100%, 980px);
  margin: 0 auto 26px;
  padding: 18px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.credit-block-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.2;
}

.credit-block-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.credit-block-buy {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.credit-block-buy .credit-select-field {
  min-width: 210px;
}

.credit-block-price .price-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--heading);
}

.credit-block-buy form {
  margin: 0;
  display: grid;
}

/* Wrapper de CTA épinglé en bas de carte (comme .price-card form sur choose-plan),
   pour aligner les boutons même quand le CTA est « Votre forfait » (pas un form). */
.price-card .price-cta-wrap {
  display: grid;
  margin-top: auto;
}

/* Forfait courant : CTA grisé, non cliquable. */
.price-cta.is-current {
  background: color-mix(in srgb, var(--border) 34%, transparent);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
  cursor: default;
}

.price-cta.is-current:hover {
  background: color-mix(in srgb, var(--border) 34%, transparent);
  border-color: var(--border);
  color: var(--muted);
}

@media (max-width: 620px) {
  .credit-block {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }
  .credit-block-buy {
    justify-content: space-between;
  }
}

/* ============================================================
   Import de fichiers v2 : dropzone, progression d'upload,
   écran « Vérifier et lancer », résultat document.
   ============================================================ */
.dropzone[data-upload-dropzone] {
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.dropzone[data-upload-dropzone]:hover,
.dropzone[data-upload-dropzone]:focus-visible,
.dropzone.is-dragover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 6%, var(--panel-muted));
}

.upload-progress {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel-muted);
}

.upload-files {
  display: grid;
  gap: 4px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--primary);
  transition: width 0.25s ease;
}

.spinner-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: spinner-dot-pulse 1s ease-in-out infinite;
}

@keyframes spinner-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

/* Aperçu d'un document en vignettes — LECTURE SEULE (plus de sélection). */
.doc-thumb-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.doc-thumb {
  width: 116px;
  display: grid;
  gap: 6px;
  justify-items: center;
  font-size: 12px;
  color: var(--muted);
}

.doc-thumb img,
.doc-thumb-empty,
.doc-thumb.is-skeleton {
  width: 116px;
  height: 150px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  object-fit: cover;
  object-position: top center;
}

.doc-thumb-empty {
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--muted);
}

.doc-thumb.is-skeleton {
  background: var(--soft);
  animation: spinner-dot-pulse 1.4s ease-in-out infinite;
}

/* Footer d'action : carte autonome (bordure complète + coins arrondis),
   pas une barre pleine largeur à simple filet du haut (effet « tronqué »). */
.review-footer {
  position: sticky;
  bottom: 16px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 16px 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  z-index: 5;
}

.review-footer .choice-row {
  margin-right: 8px;
}

/* ------------------------------------------------------------------ *
 * Cartes de résultat « crème chaleureuses » (design Claude, 07/2026)  *
 * Fond crème, coins doux, ombre tiède, anneau SVG dégradé, badge miel *
 * ------------------------------------------------------------------ */
:root {
  --result-card-bg: var(--panel);
  --result-card-border: var(--border);
  --result-card-shadow: var(--shadow);
  --result-track: #e8e7e1;
  --result-eyebrow: var(--subtle);
  --result-body: var(--muted);
  --result-heading: var(--text);
  --result-badge-bg: var(--success-soft);
  --result-badge-ink: var(--success);
  --result-good: #158a42;
  --result-warning: #b45309;
  --result-danger: #dc2626;
}

body.dark,
html.dark body {
  --result-card-bg: var(--panel);
  --result-card-border: var(--border);
  --result-card-shadow: var(--shadow);
  --result-track: #2f3237;
  --result-eyebrow: var(--subtle);
  --result-body: var(--muted);
  --result-heading: var(--text);
  --result-badge-bg: var(--success-soft);
  --result-badge-ink: var(--success);
  --result-good: #4ade80;
  --result-warning: #fbbf24;
  --result-danger: #f87171;
}

.score-panel,
.plagiarism-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
  border: 1px solid var(--result-card-border);
  border-radius: 24px;
  background: var(--result-card-bg);
  box-shadow: var(--result-card-shadow);
  padding: 26px 26px 24px;
}

.score-panel .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 24px;
}

.score-panel .card-head .eyebrow {
  margin: 0;
  color: var(--result-eyebrow);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.verdict-badge svg {
  width: 12px;
  height: 12px;
}

.verdict-badge.is-good {
  background: var(--result-badge-bg);
  color: var(--result-badge-ink);
}

.verdict-badge.is-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.verdict-badge.is-danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.score-ring {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 172px;
  height: 172px;
  margin-top: 12px;
}

.score-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.score-ring-track {
  fill: none;
  stroke: var(--result-track);
  stroke-width: 13;
}

.score-ring-halo {
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
}

.score-ring.is-good .score-ring-halo {
  background: radial-gradient(circle, rgba(46, 168, 88, 0.14), transparent 70%);
}

.score-ring.is-warning .score-ring-halo {
  background: radial-gradient(circle, rgba(217, 146, 32, 0.14), transparent 70%);
}

.score-ring.is-danger .score-ring-halo {
  background: radial-gradient(circle, rgba(220, 60, 50, 0.12), transparent 70%);
}

.score-ring-value {
  position: relative;
  color: var(--result-heading);
  font-size: 50px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}

.score-ring-value small {
  font-size: 26px;
  font-weight: 700;
}

.score-ring-value svg {
  position: static;
  width: 44px;
  height: 44px;
  color: var(--result-eyebrow);
}

.score-ring.is-muted .score-ring-value {
  color: var(--result-eyebrow);
}

.score-ring.is-tinted.is-good .score-ring-value {
  color: var(--result-good);
}

.score-ring.is-tinted.is-warning .score-ring-value {
  color: var(--result-warning);
}

.score-ring.is-tinted.is-danger .score-ring-value {
  color: var(--result-danger);
}

.score-panel h2 {
  margin: 16px 0 0;
  color: var(--result-heading);
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.score-panel > p {
  margin: 8px 0 0;
  max-width: 300px;
  color: var(--result-body);
  font-size: 14px;
  line-height: 1.55;
}

.score-panel > a {
  margin-top: 14px;
  font-weight: 650;
}

.score-panel > .button {
  margin-top: 14px;
}

.score-panel > small.muted {
  margin-top: 10px;
}

.score-panel .progress-track {
  width: 100%;
}

.score-panel .match-list {
  width: 100%;
  margin-top: 14px;
  text-align: left;
}

.result-layout {
  gap: 20px;
}

/* Bloc « analyse en cours » : occupe la hauteur restante de la carte (souvent étirée
   par la carte voisine) et centre verticalement loader + titre + texte, sans toucher
   aux autres états. Ne fait rien si la carte n'a pas de hauteur en trop. */
.analyse-pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  width: 100%;
}

/* Loader « analyse en cours » — Claude Design lot 7i, version A « Lignes scannées ».
   Remplace l'anneau muet quand une détection (IA / plagiat) est en cours. */
.lc-loader-scan {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0 6px;
}
.lc-loader-scan-lines {
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  width: 190px;
  height: 128px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: #fff;
  border: 1px solid #e8e8ec;
  border-radius: 10px;
}
.lc-loader-scan-lines > span {
  height: 7px;
  border-radius: 3.5px;
  background: #e8e8ec;
  animation: lcdPulse 2.4s ease-in-out infinite;
}
.lc-loader-scan-beam {
  position: absolute;
  left: 8px;
  right: 8px;
  top: 6px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #6d5cf6 30%, #6d5cf6 70%, transparent);
  box-shadow: 0 0 14px 2px rgba(109, 92, 246, 0.45);
  animation: lcdScan 2.4s ease-in-out infinite;
}
@keyframes lcdScan {
  0% { top: 6px; }
  50% { top: calc(100% - 10px); }
  100% { top: 6px; }
}
@keyframes lcdPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
body.dark .lc-loader-scan-lines {
  background: var(--panel-muted);
  border-color: var(--border);
}
body.dark .lc-loader-scan-lines > span {
  background: var(--border-strong);
}
@media (prefers-reduced-motion: reduce) {
  .lc-loader-scan-lines > span { animation: none; opacity: 0.6; }
  .lc-loader-scan-beam { animation: none; opacity: 0.8; }
}

/* ============================================================
   Fonctionnalités hors formule : montrées, pas cachées.
   Convention reprise du freescan (/detecteur-ia/) : l'élément
   reste visible, grisé, et explique au survol ce qui le
   débloque. Cacher l'option privait l'utilisateur de la seule
   information qui le ferait monter de formule.

   ⚠️ Sélecteurs volontairement spécifiques : `.toggle-card span`
   impose width:34px / grid-row:span 2 / display:grid à TOUS les
   span de la carte. Sans reprendre la main dessus, la pastille
   se replie sur 34 px et l'infobulle sort en colonne de texte.
   ============================================================ */
.is-locked {
  position: relative;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}

.is-locked > :not(.lc-tooltip):not(.lc-lock-badge) {
  opacity: 0.55;
}

.toggle-card.is-locked,
.segment.is-locked {
  background: var(--panel-muted);
}

.toggle-card.is-locked strong,
.toggle-card.is-locked small,
.segment.is-locked {
  color: var(--muted);
}

.toggle-card .lc-lock-badge,
.segment .lc-lock-badge,
.lc-lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  grid-row: auto;
  place-items: center;
  align-items: center;
  gap: 3px;
  width: auto;
  height: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 1;
}

.lc-lock-badge svg {
  width: 10px;
  height: 10px;
  flex: none;
}

.toggle-card .lc-tooltip,
.segment .lc-tooltip,
.lc-tooltip {
  position: absolute;
  left: 0;
  right: auto;
  bottom: calc(100% + 8px);
  z-index: 30;
  display: block;
  grid-row: auto;
  place-items: initial;
  width: min(300px, calc(100vw - 40px));
  height: auto;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--panel);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.is-locked:hover .lc-tooltip,
.is-locked:focus-visible .lc-tooltip,
.is-locked:focus-within .lc-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* Première carte de la grille : l'infobulle déborderait à gauche. */
.toggle-grid > .is-locked:first-child .lc-tooltip {
  left: 0;
}

/* Bandeau d'upsell contextuel (ex. plusieurs documents déposés sans
   l'analyse en masse) : apparaît là où l'utilisateur bute, pas dans
   un coin de la page. */
.lc-upsell-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.lc-upsell-inline .button {
  margin-left: auto;
  flex: none;
}

@media (max-width: 640px) {
  .lc-upsell-inline { flex-wrap: wrap; }
  .lc-upsell-inline .button { margin-left: 0; width: 100%; justify-content: center; }
}

/* Icône d'action destructive (retirer un document d'un import). */
.icon-button.danger {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button.danger:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, var(--border));
  background: var(--danger-soft);
}

.icon-button.danger svg { width: 16px; height: 16px; }

/* Liste des gains d'une montée de formule (modale d'upsell). */
.modal-gains {
  display: grid;
  gap: 7px;
  margin: 14px 0 12px;
  padding: 0;
  list-style: none;
}

.modal-gains li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.45;
}

.modal-gains svg {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--primary);
}

/* Historique de la barre latérale : empêcher tout débordement horizontal.
   .history-title portait déjà l'ellipse, mais .history-list est une GRILLE :
   ses pistes s'élargissent au contenu (min-width:auto par défaut), si bien
   qu'un titre long poussait la liste et faisait apparaître une barre de
   défilement horizontale. On borne la piste et on coupe net. */
.history-list {
  grid-template-columns: minmax(0, 1fr);
  overflow-x: hidden;
}

.history-item {
  min-width: 0;
}

/* ============================================================
   Pied de page légal de /choose-plan (paywall).
   Cet écran est le seul atteignable par un inscrit non payant :
   il porte donc la mention TTC et les liens contractuels, ainsi
   qu'une sortie (déconnexion) — sans quoi la page est un
   cul-de-sac. Liens relatifs : staging doit rester sur staging.
   ============================================================ */
.paywall-legal {
  margin: 28px auto 0;
  max-width: 900px;
  padding: 0 16px 8px;
  text-align: center;
}

.paywall-legal-tax {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.paywall-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.paywall-legal-links form {
  display: inline;
  margin: 0;
}

.paywall-legal-links a,
.paywall-legal-links button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.paywall-legal-links a:hover,
.paywall-legal-links button:hover {
  color: var(--text);
}

/* Verrou sur une commande d'UNE ligne (bouton), pas sur une carte : la pastille
   .lc-lock-badge est absolue en haut à droite, ce qui la fait chevaucher le
   libellé d'un bouton. Ici elle redevient un élément de flux, à la suite du
   texte, et l'infobulle se centre sous le bouton. */
.is-locked-inline .lc-lock-badge {
  position: static;
  margin-left: 6px;
}

.is-locked-inline .lc-tooltip {
  left: 50%;
  transform: translate(-50%, 4px);
}

.is-locked-inline:hover .lc-tooltip,
.is-locked-inline:focus-visible .lc-tooltip,
.is-locked-inline:focus-within .lc-tooltip {
  transform: translate(-50%, 0);
}
