/* ==========================================================================
   Hash Calc - feuille de styles

    1. Couleurs et mesures        8. Fiches (fichiers et textes)
    2. Base                       9. Panneaux : verifier, algorithmes, affichage
    3. Boutons et champs         10. Comparaison, Bon a savoir, pied de page
    4. Barre du haut             11. Depot, notifications, menus
    5. Mise en page              12. Animations
    6. Calcul en cours           13. Ecrans etroits
    7. Accueil (zone de depot)

   Theme : light-dark() suit le systeme ; data-theme="light|dark" sur <html> force
   un theme (bouton de la barre, memorise par app.js et theme-init.js).
   ========================================================================== */


/* ---------- 1. Couleurs et mesures ------------------------------------- */

:root {
  color-scheme: light dark;

  /* Fond : creme rose le jour, nuit violette ; halos de couleur dans les coins,
     motif de petits dieses et grande empreinte en filigrane (voir 2. Base) */
  --bg:            light-dark(#fbf6f2, #100d16);
  --glow-1:        light-dark(rgb(236 72 153 / .21), rgb(219 39 119 / .25));   /* framboise */
  --glow-2:        light-dark(rgb(251 146 60 / .22), rgb(249 115 22 / .11));   /* abricot */
  --glow-3:        light-dark(rgb(139 92 246 / .18), rgb(124 58 237 / .25));   /* violet */
  --glow-4:        light-dark(rgb(16 185 129 / .13), rgb(34 211 238 / .12));   /* menthe, cyan */
  --pattern:       light-dark(rgb(150 50 105 / .13), rgb(255 190 225 / .075));
  --watermark:     light-dark(rgb(168 38 108 / .075), rgb(242 125 182 / .07));

  /* Cartes et panneaux, un peu translucides (les halos transparaissent) ; surfaces
     opaques pour les champs, menus et fenetres */
  --card:          light-dark(rgb(255 255 255 / .8), rgb(31 25 39 / .76));
  --card-border:   light-dark(rgb(168 38 108 / .15), rgb(242 125 182 / .14));
  --surface:       light-dark(#ffffff, #1f1a26);
  --surface-2:     light-dark(#fbf8f6, #191520);
  --surface-3:     light-dark(#f5eef0, #2b2433);
  --border:        light-dark(#ebe1e2, #342c3d);
  --border-strong: light-dark(#d9cacd, #4b4054);

  /* Texte (contraste d'au moins 4,5:1 sur les surfaces) */
  --text:          light-dark(#1e1a1c, #f1ebf0);
  --text-2:        light-dark(#5b5357, #bab0b7);
  --text-3:        light-dark(#756c71, #958a92);

  /* Accent : framboise (rose fuchsia la nuit), et corail pour les degrades
     (texte blanc lisible sur les deux en clair, texte fonce en sombre) */
  --accent:        light-dark(#a8266c, #f27db6);
  --accent-2:      light-dark(#c4413a, #ffab7d);
  --accent-hover:  light-dark(#8c1c59, #ff9cca);
  --accent-soft:   light-dark(rgb(168 38 108 / .09), rgb(242 125 182 / .13));
  --accent-softer: light-dark(rgb(168 38 108 / .045), rgb(242 125 182 / .06));
  --on-accent:     light-dark(#ffffff, #2a0a1b);

  /* Etats : vert = conforme, rouge orange = different (jamais la couleur seule :
     toujours une icone et un texte) */
  --ok:            light-dark(#1b7a4b, #6fd39d);
  --ok-soft:       light-dark(#e4f3ea, rgb(111 211 157 / .11));
  --bad:           light-dark(#bf3b1c, #ff8e70);
  --bad-soft:      light-dark(#fbe9e3, rgb(255 142 112 / .11));
  --warn:          light-dark(#8f5c0c, #ecb562);
  --warn-soft:     light-dark(#fbf1de, rgb(236 181 98 / .11));
  --on-state:      light-dark(#ffffff, #160f18);   /* texte sur un fond --ok, --bad ou --warn */

  /* Notifications (contraste inverse) */
  --ink:           light-dark(#241f22, #f1ebf0);
  --on-ink:        light-dark(#f5f1f3, #1e1a1c);
  --on-ink-accent: light-dark(#ffa4cf, #a8266c);

  --shadow-color:  light-dark(rgb(60 30 45 / .08), rgb(0 0 0 / .45));
  --shadow-sm:     0 1px 2px var(--shadow-color);
  --shadow-md:     0 1px 2px var(--shadow-color), 0 8px 24px -8px var(--shadow-color);
  --shadow-lg:     0 2px 6px var(--shadow-color), 0 22px 56px light-dark(rgb(60 30 45 / .18), rgb(0 0 0 / .6));
  --shadow-card:   0 1px 2px var(--shadow-color), 0 14px 34px -22px light-dark(rgb(168 38 108 / .5), rgb(0 0 0 / .75));
  --ring:          0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent);

  /* Familles d'algorithmes (etiquettes des empreintes) */
  --fam-sha3:      light-dark(#6a46d6, #b6a0ff);
  --fam-blake:     light-dark(#0b7580, #5fd3dc);
  --fam-other:     light-dark(#975a0f, #f0b46a);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
  --topbar-h: 60px;
}

:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

/* Navigateurs sans light-dark() (anterieurs a 2024) : theme clair seulement, plutot
   qu'une page sans couleurs. Le bouton de theme y est masque. */
@supports not (color: light-dark(#000, #fff)) {
  :root, :root[data-theme] {
    color-scheme: light;
    --bg: #fbf6f2; --glow-1: rgb(236 72 153 / .21); --glow-2: rgb(251 146 60 / .22);
    --glow-3: rgb(139 92 246 / .18); --glow-4: rgb(16 185 129 / .13);
    --pattern: rgb(150 50 105 / .13); --watermark: rgb(168 38 108 / .075);
    --card: rgb(255 255 255 / .8); --card-border: rgb(168 38 108 / .15);
    --surface: #ffffff; --surface-2: #fbf8f6;
    --surface-3: #f5eef0; --border: #ebe1e2; --border-strong: #d9cacd;
    --text: #1e1a1c; --text-2: #5b5357; --text-3: #756c71;
    --fam-sha3: #6a46d6; --fam-blake: #0b7580; --fam-other: #975a0f;
    --accent: #a8266c; --accent-2: #c4413a; --accent-hover: #8c1c59; --accent-soft: rgb(168 38 108 / .09);
    --accent-softer: rgb(168 38 108 / .045); --on-accent: #ffffff;
    --ok: #1b7a4b; --ok-soft: #e4f3ea; --bad: #bf3b1c; --bad-soft: #fbe9e3;
    --warn: #8f5c0c; --warn-soft: #fbf1de; --on-state: #ffffff;
    --ink: #241f22; --on-ink: #f5f1f3; --on-ink-accent: #ffa4cf;
    --shadow-color: rgb(60 30 45 / .08);
    --shadow-lg: 0 2px 6px rgb(60 30 45 / .08), 0 22px 56px rgb(60 30 45 / .18);
    --shadow-card: 0 1px 2px rgb(60 30 45 / .08), 0 14px 34px -22px rgb(168 38 108 / .5);
  }
  .theme-btn { display: none !important; }
  .fp rect { fill: hsl(var(--h) 78% 93%); }
  .fp stop:first-child { stop-color: hsl(var(--h) 60% 40%); }
  .fp stop:last-child { stop-color: hsl(var(--h2) 60% 42%); }
  .card[data-twin], .cgroup { --twin: hsl(var(--twin-h) 62% 46%); }
}


/* ---------- 2. Base ------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 400 15px/1.5 var(--font);
  color: var(--text);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

/* Fond en trois couches fixes, derriere le contenu :
   1. halos de couleur dans les quatre coins (degrades, ci-dessous) ; */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(75vmax 52vmax at -8% -12%, var(--glow-1), transparent 62%),
    radial-gradient(62vmax 48vmax at 108% -8%, var(--glow-2), transparent 62%),
    radial-gradient(72vmax 56vmax at 108% 112%, var(--glow-3), transparent 62%),
    radial-gradient(62vmax 50vmax at -8% 108%, var(--glow-4), transparent 62%);
}

/* 2. et 3. dessins de div.decor (index.html) : motif de petits dieses en
   quinconce, grande empreinte digitale en filigrane en bas a droite. Ils sont
   dans la page et non en fichiers : ouverte en fichier local (double-clic), une
   page ne peut pas charger une image SVG qui sert de masque CSS. */
.decor {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.decor__motif {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.decor__motif path { fill: none; stroke: var(--pattern); stroke-width: 1.3; stroke-linecap: round; }
.decor__motif circle { fill: var(--pattern); }

.decor__empreinte {
  position: absolute;
  right: -7vmin;
  bottom: -16vmin;
  width: min(74vmin, 640px);
  height: auto;
  aspect-ratio: 200 / 220;
  rotate: -16deg;
}

.decor__empreinte path { fill: none; stroke: var(--watermark); stroke-width: 4.2; stroke-linecap: round; }

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img, svg { display: block; }
a { color: var(--accent); text-underline-offset: 3px; }
code { font: .92em/1 var(--mono); }
[hidden] { display: none !important; }

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

kbd {
  display: inline-block;
  min-width: 1.7em;
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--surface);
  color: var(--text-2);
  font: 600 11.5px/1.5 var(--font);
  text-align: center;
  white-space: nowrap;
}

.noscript {
  margin: 16px;
  padding: 14px 18px;
  border: 1px solid var(--bad);
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: var(--bad);
}


/* ---------- 3. Boutons et champs ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .1s;
}

.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; }

.btn--primary {
  background: var(--accent) linear-gradient(135deg, var(--accent) 20%, var(--accent-2));
  color: var(--on-accent);
  box-shadow: 0 1px 2px var(--shadow-color), 0 8px 18px -10px color-mix(in srgb, var(--accent) 80%, transparent),
    inset 0 1px 0 rgb(255 255 255 / .18);
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.07) saturate(1.08); }

.btn--ghost {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.btn--ghost:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-3); }

.btn--small {
  height: 30px;
  padding: 0 11px;
  gap: 6px;
  border-radius: 8px;
  font-size: 13px;
}
.btn--small .icon { width: 15px; height: 15px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  transition: background-color .15s, color .15s;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.icon-btn:disabled { opacity: .4; }

.icon-btn--sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}
.icon-btn--sm .icon { width: 16px; height: 16px; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}
.link-btn:hover { background: var(--accent-softer); text-decoration: underline; text-underline-offset: 3px; }
.link-btn .icon { width: 15px; height: 15px; }

.input,
.select {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.select {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.select option { background: var(--surface); color: var(--text); }

.input:hover, .select:hover { border-color: color-mix(in srgb, var(--text-3) 60%, var(--border-strong)); }

.input:focus, .select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}


/* ---------- 4. Barre du haut -------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 18px 0 20px;
  border-bottom: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--surface) 84%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand__logo {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-pop);
}

.brand:hover .brand__logo { transform: rotate(-8deg) scale(1.05); }

.brand__text {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.brand__name {
  font: 700 17px/1 var(--font-display);
  letter-spacing: -.01em;
  white-space: nowrap;
}

.brand__tag {
  margin-left: 10px;
  overflow: hidden;
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Chevron de l'ecran etroit, colle au logo (voir 13.) */
.brand__menu {
  display: none;
  place-items: center;
  flex: none;
  width: 22px;
  height: 34px;
  margin-left: -7px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-3);
}
.brand__menu:hover { background: var(--surface-3); color: var(--text); }
.brand__menu .icon { width: 16px; height: 16px; }

/* Espacements des autres outils : 6 px entre les boutons, 10 px de chaque cote du
   separateur (6 px d'ecart + 4 px de marge), boutons de 36 px. */
.topbar__actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar__sep {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 4px;
  background: var(--border);
}

/* Bouton de theme : l'icone montre le mode en cours */
.theme-btn .icon { display: none; }
.theme-btn[data-mode="auto"] .theme-btn__auto,
.theme-btn[data-mode="light"] .theme-btn__light,
.theme-btn[data-mode="dark"] .theme-btn__dark { display: block; }

/* Progression globale, collee sous la barre */
.global-progress {
  position: sticky;
  top: var(--topbar-h);
  z-index: 29;
  height: 3px;
  margin-bottom: -3px;
  overflow: hidden;
}

.global-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform .2s linear;
}


/* ---------- 5. Mise en page --------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  grid-template-areas:
    "work  side"
    "about side";
  align-items: start;
  gap: 28px;
  width: min(1240px, 100%);
  margin: 0 auto;
  padding: 28px 28px 20px;
}

.work { grid-area: work; min-width: 0; }
.about { grid-area: about; min-width: 0; }

.side {
  grid-area: side;
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  max-height: calc(100vh - var(--topbar-h) - 36px);
  max-height: calc(100dvh - var(--topbar-h) - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  /* l'anneau de focus des champs ne doit pas etre coupe par le defilement */
  margin: -4px;
  padding: 4px;
}

.panel {
  padding: 16px 16px 18px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font: 700 12px/1.2 var(--font-display);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.panel__title .icon { width: 17px; height: 17px; color: var(--accent); }
.panel > .panel__title { margin-bottom: 12px; }


/* ---------- 6. Calcul en cours ------------------------------------------ */

.status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 8px 8px 8px 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 7%, var(--card));
  box-shadow: var(--shadow-card);
  animation: fade-in .2s;
}

.status__text {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
}

.status__text strong { font-weight: 650; }

.status__spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}


/* ---------- 7. Accueil (zone de depot) ---------------------------------- */

.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 24px 26px;
  border: 2px dashed color-mix(in srgb, var(--accent) 32%, var(--border-strong));
  border-radius: 22px;
  background:
    radial-gradient(600px 260px at 50% 0%, var(--accent-soft), transparent 70%),
    var(--card);
  box-shadow: var(--shadow-card);
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease);
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.dropzone__art {
  width: 200px;
  height: 128px;
  margin-bottom: 8px;
  overflow: visible;
}

.art__doc path {
  stroke-width: 2.5;
  stroke-linejoin: round;
}

.art__doc--back {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: rotate(-9deg);
  transition: transform .45s var(--ease-pop);
}

.art__doc--back path {
  fill: var(--surface-3);
  stroke: var(--border-strong);
}

.art__doc--front {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform .45s var(--ease-pop);
}

.art__page { fill: var(--surface); stroke: var(--text-2); }
.art__fold { fill: none; stroke: var(--text-2); }

.art__grad stop:first-child { stop-color: var(--accent); }
.art__grad stop:last-child { stop-color: var(--accent-2); }

.art__print path {
  fill: none;
  stroke: url(#art-grad);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 60;
  stroke-dashoffset: 0;
}

.art__badge circle { fill: var(--ok); }
.art__badge path {
  fill: none;
  stroke: #fff;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art__badge {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .45s var(--ease-pop);
}

.art__hash path {
  fill: none;
  stroke: var(--text-3);
  stroke-width: 3.2;
  stroke-linecap: round;
}
.art__hash {
  transform-box: fill-box;
  transform-origin: center;
  transform: rotate(-12deg);
  transition: transform .45s var(--ease-pop);
}

.dropzone:hover .art__doc--front,
.dropzone.is-over .art__doc--front { transform: translateY(-6px) rotate(3deg); }
.dropzone:hover .art__doc--back,
.dropzone.is-over .art__doc--back { transform: rotate(-15deg) translateX(-4px); }
.dropzone:hover .art__badge,
.dropzone.is-over .art__badge { transform: scale(1.12) rotate(-8deg); }
.dropzone:hover .art__hash,
.dropzone.is-over .art__hash { transform: rotate(4deg) translateY(-4px); }
.dropzone:hover .art__print path,
.dropzone.is-over .art__print path { animation: draw 1.1s var(--ease) both; }

.dropzone__title {
  font: 700 clamp(21px, 2.4vw, 25px)/1.2 var(--font-display);
  letter-spacing: -.015em;
}

.dropzone__text {
  max-width: 440px;
  margin-top: 6px;
  color: var(--text-2);
}

.dropzone__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}

.dropzone__hint {
  margin-top: 16px;
  color: var(--text-3);
  font-size: 13px;
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.features li {
  display: flex;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.features strong { color: var(--text); font-weight: 650; }
.features .icon { margin-top: 1px; color: var(--accent); }


/* ---------- 8. Fiches (fichiers et textes) ------------------------------ */

.sources {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  position: relative;
  padding: 14px 16px 12px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
  animation: rise-in .3s var(--ease);
  transition: border-color .25s, box-shadow .25s;
  content-visibility: auto;
  contain-intrinsic-size: auto 220px;
}

.card[data-verdict="match"] { border-color: color-mix(in srgb, var(--ok) 50%, transparent); }
.card[data-verdict="mismatch"],
.card[data-verdict="nomatch-alone"] { border-color: color-mix(in srgb, var(--bad) 50%, transparent); }
.card[data-state="error"] { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* Fiches au contenu identique : liseré de la couleur du groupe (teinte --twin-h
   posee par app.js : violet, bleu, cyan ou pourpre, jamais celles des verdicts) */
.card[data-twin] {
  --twin: light-dark(hsl(var(--twin-h) 62% 46%), hsl(var(--twin-h) 80% 66%));
  box-shadow: inset 4px 0 0 var(--twin), var(--shadow-card);
}

.card__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}

.card__icon .icon { width: 20px; height: 20px; }
.card__icon.has-fp { background: none; }

/* Empreinte visuelle : dessin tire de l'empreinte (app.js, fingerprint()). Deux
   contenus identiques ont le meme dessin et les memes couleurs. */
.fp {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
}

.fp rect { fill: light-dark(hsl(var(--h) 78% 93%), hsl(var(--h) 38% 21%)); }
.fp path { fill: none; stroke-width: 2.1; stroke-linecap: round; }
.fp stop:first-child { stop-color: light-dark(hsl(var(--h) 60% 40%), hsl(var(--h) 85% 72%)); }
.fp stop:last-child { stop-color: light-dark(hsl(var(--h2) 60% 42%), hsl(var(--h2) 85% 70%)); }
.fp.is-new { animation: fp-in .55s var(--ease-pop); }

/* Pastille "= autre fichier" (contenu identique) */
.twin {
  display: inline-flex;
  align-items: center;
  flex: none;
  max-width: 55%;
  height: 21px;
  margin-left: 8px;
  padding: 0 8px;
  overflow: hidden;
  border-radius: 99px;
  background: color-mix(in srgb, var(--twin) 16%, var(--surface));
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.twin__eq {
  flex: none;
  margin-right: 5px;
  color: var(--twin);
  font-size: 14px;
  font-weight: 800;
}

.twin__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__line {
  display: flex;
  align-items: center;
  min-width: 0;
}

.card__line .card__name { min-width: 0; }

.card__title {
  flex: 1;
  min-width: 0;
}

.card__name {
  display: block;
  overflow: hidden;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card__dir { color: var(--text-3); font-weight: 500; }

.card__meta {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__actions {
  display: flex;
  gap: 2px;
  margin-right: -6px;
}

/* Verdict : un coup de tampon, comme le "En travaux" de l'accueil Barbatools */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 3px 9px 3px 7px;
  border: 2px solid currentColor;
  border-radius: 7px;
  outline: 1px solid currentColor;
  outline-offset: 2px;
  color: var(--ok);
  font: 800 11px/1.25 var(--font-display);
  letter-spacing: .09em;
  text-transform: uppercase;
  white-space: nowrap;
  transform: rotate(-4deg);
}

.stamp .icon { width: 14px; height: 14px; stroke-width: 3; }
.stamp--bad { color: var(--bad); }
.stamp.is-new { animation: stamp-in .5s var(--ease-pop) both; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.tag .icon { width: 13px; height: 13px; }
.tag--accent { background: var(--accent-soft); color: var(--accent); }

/* Barre de progression d'une fiche */
.card__progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-3);
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background:
    linear-gradient(115deg, rgb(255 255 255 / .28) 25%, transparent 25% 50%, rgb(255 255 255 / .28) 50% 75%, transparent 75%) 0 0 / 18px 18px,
    linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform .15s linear;
  animation: stripes .8s linear infinite;
}

.card__progress small {
  flex: none;
  color: var(--text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

/* Saisie d'un texte */
.editor { margin-top: 12px; }

.editor textarea {
  display: block;
  width: 100%;
  min-height: 78px;
  max-height: 50vh;
  padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: 14px/1.5 var(--mono);
  resize: vertical;
  transition: border-color .15s, box-shadow .15s;
}

.editor textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.editor.is-invalid textarea { border-color: var(--bad); }

.editor__opts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 9px;
  color: var(--text-2);
  font-size: 13px;
}

.editor__opts .select {
  height: 30px;
  font-size: 13px;
}

.editor__opts label:not(.check) {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.editor__msg {
  margin-top: 7px;
  color: var(--bad);
  font-size: 13px;
}

/* Empreintes : une ligne par algorithme */
.hashes {
  margin: 12px -8px 0;
}

.hash {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 10px;
  min-height: 38px;
  padding: 4px 4px 4px 8px;
  border-radius: 9px;
  transition: background-color .15s;
}

.hash + .hash { margin-top: 2px; }
.hash:hover { background: color-mix(in srgb, var(--surface-3) 70%, transparent); }

.hash__algo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font: 700 12px/1.2 var(--font);
  letter-spacing: .02em;
  white-space: nowrap;
}

/* Etiquette de l'algorithme, teintee selon sa famille */
.hash__name {
  padding: 3px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--fam) 12%, transparent);
  color: var(--fam);
}

.hash[data-fam="sha2"] { --fam: var(--accent); }
.hash[data-fam="sha3"] { --fam: var(--fam-sha3); }
.hash[data-fam="blake"] { --fam: var(--fam-blake); }
.hash[data-fam="other"] { --fam: var(--fam-other); }
.hash[data-fam="weak"] { --fam: var(--text-2); }

/* Comparaison au survol (ou au toucher de l'etiquette) : la ligne choisie, puis
   les memes algorithmes des autres fiches, identiques (=) ou differents (=/) */
.hash__cmp { display: none; }

.hash.is-pivot {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
}

.hash.is-same {
  background: var(--ok-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 55%, transparent);
}

.hash.is-different {
  background: var(--bad-soft);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--bad) 40%, transparent);
}

.hash.is-same .hash__cmp,
.hash.is-different .hash__cmp {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: var(--on-state);
  font: 800 13px/1 var(--font);
}

.hash.is-same .hash__cmp { background: var(--ok); }
.hash.is-same .hash__cmp::before { content: "="; }
.hash.is-different .hash__cmp { background: var(--bad); }
.hash.is-different .hash__cmp::before { content: "\2260"; }

.hash__value {
  min-width: 0;
  color: var(--text);
  font: 13.5px/1.55 var(--mono);
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
  cursor: text;
}

/* Groupes de 8 caracteres un peu espaces pour la lecture (la copie reste d'un bloc) ;
   une ligne ne se coupe qu'entre deux groupes */
.hash__value b {
  display: inline-block;
  font-weight: inherit;
  margin-right: .38ch;
}

.hash__value b:last-child { margin-right: 0; }

/* Animation d'apparition : texte provisoire, pas encore l'empreinte */
.hash__value.is-revealing {
  user-select: none;
  -webkit-user-select: none;
}

.hash__value.is-wait {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3) 0%, color-mix(in srgb, var(--surface-3) 40%, var(--surface)) 50%, var(--surface-3) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  user-select: none;
}

.hash__value.is-na {
  color: var(--text-3);
  font: italic 13px/1.4 var(--font);
  user-select: none;
}

.hash.is-match {
  background: var(--ok-soft);
  box-shadow: inset 3px 0 0 var(--ok);
}
.hash.is-match .hash__name { --fam: var(--ok); }
.hash.is-mismatch .hash__name { --fam: var(--bad); }

.hash__mark {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ok);
  color: var(--on-state);
}

.hash__mark .icon { width: 11px; height: 11px; stroke-width: 3.4; }
.hash.is-mismatch .hash__mark { background: var(--bad); }

.hash .icon-btn { width: 32px; height: 32px; }
.hash .icon-btn .icon { width: 16px; height: 16px; }
.icon-btn.is-done { color: var(--ok); }

/* Explication du verdict sous les empreintes */
.card__note {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
}

.card__note .icon { width: 16px; height: 16px; margin-top: 1px; }
.card__note--ok { background: var(--ok-soft); color: color-mix(in srgb, var(--ok) 70%, var(--text)); }
.card__note--bad { background: var(--bad-soft); color: color-mix(in srgb, var(--bad) 70%, var(--text)); }
.card__note--warn { background: var(--warn-soft); color: color-mix(in srgb, var(--warn) 70%, var(--text)); }
.card__note .btn { margin-left: auto; align-self: center; }
.card__note-body { flex: 1; min-width: 0; }

/* Attendu / calcule, l'un sous l'autre : caracteres differents surlignes */
.vs {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 10px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}

.vs__label {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 700;
}

.vs__value {
  min-width: 0;
  font: 12.5px/1.55 var(--mono);
  overflow-wrap: anywhere;
}

.vs__value b {
  display: inline-block;
  margin-right: .38ch;
  font-weight: inherit;
}

.vs__value mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--bad) 30%, transparent);
  color: inherit;
}

.vs__sum {
  grid-column: 1 / -1;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12px;
}

.card__empty {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 13px;
}

/* Rangee "ajouter" sous les fiches : fichiers, dossier, texte */
.add-row {
  display: flex;
  gap: 6px;
  margin-top: 14px;
  padding: 6px;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  transition: border-color .15s;
}

.add-row:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }

.add-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  transition: background-color .15s, color .15s;
}

.add-row button:hover { background: var(--accent-softer); color: var(--accent); }
.add-row__main { flex: 1; }


/* ---------- 9. Panneaux : verifier, algorithmes, affichage --------------- */

.field__label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
}

.expected { position: relative; }

.expected textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 220px;
  padding: 11px 38px 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  font: 13px/1.45 var(--mono);
  resize: none;
  overflow-wrap: anywhere;
  field-sizing: content;
  transition: border-color .15s, box-shadow .15s;
}

.expected textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}

.expected textarea::placeholder { font-family: var(--font); font-size: 13.5px; }

.verify[data-verdict="ok"] .expected textarea { border-color: color-mix(in srgb, var(--ok) 60%, var(--border-strong)); }
.verify[data-verdict="bad"] .expected textarea,
.verify[data-verdict="conflict"] .expected textarea { border-color: color-mix(in srgb, var(--bad) 60%, var(--border-strong)); }

.expected__clear {
  position: absolute;
  top: 7px;
  right: 6px;
}

#btn-list { margin: 8px 0 0 -6px; }

.verdict { margin-top: 12px; }
.verdict:empty { display: none; }

.verdict__hint {
  color: var(--text-3);
  font-size: 13px;
  line-height: 1.5;
}

.verdict__box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  animation: rise-in .25s var(--ease);
}

.verdict__icon {
  display: grid;
  place-items: center;
  grid-row: span 2;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
}

.verdict__icon .icon { width: 18px; height: 18px; stroke-width: 2.6; }

.verdict__title {
  align-self: end;
  font-weight: 700;
  line-height: 1.3;
}

.verdict__detail {
  min-width: 0;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.verdict__box--ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.verdict__box--ok .verdict__icon { background: var(--ok); color: var(--on-state); }
.verdict__box--ok .verdict__title { color: var(--ok); }

.verdict__box--bad { border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.verdict__box--bad .verdict__icon { background: var(--bad); color: var(--on-state); }
.verdict__box--bad .verdict__title { color: var(--bad); }

.verdict__box--warn { border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.verdict__box--warn .verdict__icon { background: var(--warn); color: var(--on-state); }
.verdict__box--warn .verdict__title { color: var(--warn); }

.verdict__box--wait .verdict__icon .status__spinner { width: 16px; height: 16px; border-width: 2px; }

.verdict__extra {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.verdict__extra .btn { width: 100%; }

.verdict__more {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.verdict__list {
  margin-top: 10px;
  font-size: 13px;
}

.verdict__list summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}

.verdict__list ul {
  margin-top: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.verdict__list li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 0;
  overflow-wrap: anywhere;
}

.verdict__list li .icon { width: 14px; height: 14px; }
.verdict__list .is-ok .icon { color: var(--ok); }
.verdict__list .is-bad .icon { color: var(--bad); }
.verdict__list .is-missing { color: var(--text-3); }

/* Comparaison caractere par caractere (erreur de copie probable) */
.diff {
  display: block;
  margin-top: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--surface);
  font: 12.5px/1.5 var(--mono);
  overflow-wrap: anywhere;
}

.diff mark {
  border-radius: 3px;
  background: color-mix(in srgb, var(--bad) 30%, transparent);
  color: inherit;
  font-weight: 700;
}

.algos .panel__head { margin-bottom: 8px; }

.presets {
  display: flex;
  gap: 2px;
  margin-right: -6px;
}

.presets .link-btn { font-size: 12.5px; }

.algo-group + .algo-group { margin-top: 12px; }

.algo-group__name {
  margin-bottom: 7px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip {
  position: relative;
  display: inline-flex;
}

.chip input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.chip span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px 0 7px;
  border: 1px solid var(--border-strong);
  border-radius: 99px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}

/* Case a cocher dessinee : carre vide, puis coche */
.chip span::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface);
  transition: background-color .15s, border-color .15s;
}

.chip:hover span { border-color: color-mix(in srgb, var(--accent) 45%, var(--border-strong)); color: var(--text); }

.chip input:checked + span {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
}

.chip input:checked + span::before {
  border-color: var(--accent);
  background:
    linear-gradient(45deg, transparent 44%, var(--on-accent) 44% 56%, transparent 56%) 3px 5px / 4px 4px no-repeat,
    linear-gradient(-45deg, transparent 44%, var(--on-accent) 44% 56%, transparent 56%) 5px 2px / 6px 7px no-repeat,
    var(--accent);
}

.chip input:focus-visible + span { box-shadow: var(--ring); }

.chip.is-auto span { animation: wiggle .5s var(--ease); }

.note {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.note .icon { width: 15px; height: 15px; margin-top: 1px; }

/* Choix unique en boutons accoles */
.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}

.segmented label {
  position: relative;
  flex: 1;
}

.segmented input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: grid;
  place-items: center;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  pointer-events: none;
  transition: background-color .15s, color .15s, box-shadow .15s;
}

.segmented label:hover span { color: var(--text); }

.segmented input:checked + span {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--border);
}

.segmented input:focus-visible + span { box-shadow: var(--ring); }

.hmac {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.hmac summary {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.hmac summary::-webkit-details-marker { display: none; }

.hmac summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-right: 1.75px solid var(--text-3);
  border-bottom: 1.75px solid var(--text-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .2s;
}

.hmac[open] summary::after { transform: rotate(-135deg) translate(-2px, 0); }
.hmac summary .icon { color: var(--accent); }

.hmac__on {
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.hmac .hint {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.45;
}

.hmac .hint.is-error { color: var(--bad); }

.hmac__row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.hmac__row .input { flex: 1; font-family: var(--mono); font-size: 13px; }


/* ---------- 10. Comparaison, Bon a savoir, pied de page ------------------ */

/* Comparaison des fiches entre elles, en tete de la liste */
.compare { margin-bottom: 14px; }

.compare__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 12px;
}

.compare__head .panel__title { margin: 0; }

.compare__hint {
  color: var(--text-3);
  font-size: 12px;
}

@media (hover: none) {
  .compare__hint { display: none; }
}

/* Deux elements, face a face */
.duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.duo__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  text-align: center;
}

.duo__side .fp { width: 58px; height: 58px; }

/* Element encore en calcul : son icone, en attendant le dessin */
.duo__ph {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: var(--surface-3);
  color: var(--text-3);
}

.duo__ph .icon { width: 24px; height: 24px; }

.duo__side strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.duo__side small { color: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }

.duo__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.duo__sign {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: var(--on-state);
  font: 800 30px/1 var(--font-display);
  animation: fp-in .55s var(--ease-pop);
}

.duo__word {
  font: 800 11.5px/1 var(--font-display);
  letter-spacing: .1em;
  text-transform: uppercase;
}

.duo.is-same .duo__sign { background: var(--ok); box-shadow: 0 10px 24px -10px var(--ok); }
.duo.is-same .duo__word { color: var(--ok); }
.duo.is-diff .duo__sign { background: var(--bad); box-shadow: 0 10px 24px -10px var(--bad); }
.duo.is-diff .duo__word { color: var(--bad); }
.duo.is-wait .duo__sign { background: var(--surface-3); animation: none; }
.duo.is-wait .duo__word { color: var(--text-3); }

/* Les deux empreintes l'une sous l'autre, reperees par leur dessin */
.vs--duo { margin-top: 12px; align-items: center; }
.vs__fp { width: 22px; height: 22px; }
.vs.is-same .vs__sum { color: var(--ok); font-weight: 650; }

.duo__text {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 13.5px;
  text-align: center;
}

/* Plusieurs elements : groupes identiques, puis les uniques */
.compare__summary {
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 14px;
}

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

.cgroup {
  --twin: light-dark(hsl(var(--twin-h) 62% 46%), hsl(var(--twin-h) 80% 66%));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--twin) 35%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--twin) 11%, var(--surface));
}

.cgroup + .cgroup { margin-top: 8px; }
.cgroup .fp { width: 36px; height: 36px; }

.cgroup__names {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.cgroup__count {
  flex: none;
  margin-left: auto;
  color: var(--twin);
  font: 800 13px/1 var(--font-display);
  white-space: nowrap;
}

.cgroup .tag { max-width: 100%; overflow: hidden; background: var(--surface); text-overflow: ellipsis; }

.cuniques {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cunique {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 10px 3px 3px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  font-size: 12.5px;
}

.cunique .fp { width: 22px; height: 22px; }
.cunique span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cunique--more { padding: 3px 10px; color: var(--text-3); font-weight: 700; }

.compare__rest {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 13px;
}

.about {
  padding: 16px 18px 6px;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-card);
}

.about details:last-child { border-bottom: 0; }

.about__title {
  margin-bottom: 10px;
  color: var(--text-2);
  font: 700 12px/1.2 var(--font-display);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.about details {
  border-bottom: 1px solid var(--border);
}

.about summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.about summary::-webkit-details-marker { display: none; }

.about summary::before {
  content: "#";
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font: 800 13px/24px var(--mono);
  text-align: center;
  transition: transform .3s var(--ease-pop);
}

.about details[open] summary::before { transform: rotate(-12deg); }
.about summary:hover { color: var(--accent); }

.about details p {
  padding: 0 4px 14px 38px;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.6;
}

.footer {
  padding: 6px 20px 26px;
  color: var(--text-3);
  font-size: 12.5px;
  text-align: center;
}


/* ---------- 11. Depot, notifications, menus ----------------------------- */

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in .15s;
  pointer-events: none;
}

.drop-overlay__box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(560px, 100%);
  padding: 52px 24px;
  border: 2.5px dashed var(--accent);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  color: var(--accent);
  font-size: 19px;
  font-weight: 700;
  text-align: center;
  animation: rise-in .25s var(--ease);
}

.drop-overlay__box .icon { width: 38px; height: 38px; animation: bob 1s ease-in-out infinite alternate; }
.drop-overlay__box small { color: var(--text-3); font-size: 13px; font-weight: 500; }

.toasts {
  position: fixed;
  bottom: 20px;
  left: 50%;
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: min(560px, calc(100vw - 24px));
  padding: 10px 10px 10px 15px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--on-ink);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  pointer-events: auto;
  animation: slide-up .25s var(--ease);
}

.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.toast > .icon { color: var(--on-ink-accent); }
.toast.is-error > .icon { color: light-dark(#ff9f85, #bf3b1c); }
.toast p { flex: 1; overflow-wrap: anywhere; }

.toast button {
  flex: none;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--on-ink-accent);
  font-size: 13.5px;
  font-weight: 700;
}

.toast button:hover { background: rgb(127 127 127 / .2); }

/* Menu Exporter */
.menu-wrap { position: relative; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 40;
  width: max-content;
  min-width: 270px;
  max-width: calc(100vw - 16px);
  max-height: calc(100vh - var(--topbar-h) - 20px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: rise-in .16s var(--ease);
}

.menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 14px;
  text-align: left;
}

.menu button span { flex: 1; }
.menu button:hover:not(:disabled), .menu button:focus-visible { background: var(--surface-3); outline: none; }
.menu button:disabled { opacity: .45; }
.menu button .icon { color: var(--text-3); }
.menu kbd { font-size: 10.5px; }
.menu small { color: var(--text-3); font-size: 12px; }
.menu__danger:hover:not(:disabled) { color: var(--bad); }
.menu__danger:hover:not(:disabled) .icon { color: var(--bad); }

.menu__label {
  padding: 6px 10px 4px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.menu__note {
  max-width: 300px;
  padding: 2px 10px 6px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.4;
}

.menu__note:empty { display: none; }

.menu__sep,
.app-menu__sep {
  height: 1px;
  margin: 6px 4px;
  background: var(--border);
}

/* Fenetres surgissantes (menu de l'ecran etroit, raccourcis) */
.popover {
  margin: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.popover::backdrop { background: rgb(20 15 20 / .25); }

.shortcuts {
  width: min(430px, calc(100vw - 24px));
  padding: 18px 20px 18px;
}

.shortcuts[popover]:popover-open { animation: rise-in .2s var(--ease); }

.popover__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.popover__title { font: 700 17px/1.3 var(--font-display); }

.shortcuts__list {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 9px 16px;
  font-size: 14px;
}

.shortcuts__list dt { display: flex; gap: 4px; justify-content: flex-end; }
.shortcuts__list dd { color: var(--text-2); }

.popover__note {
  margin-top: 14px;
  color: var(--text-3);
  font-size: 13px;
}

/* .popover.app-menu : plus precis que .popover */
.popover.app-menu {
  position: fixed;
  inset: auto;
  top: 64px;
  left: 8px;
  margin: 0;
  width: auto;
  min-width: 250px;
  max-width: calc(100vw - 16px);
  max-height: calc(100dvh - 76px);
  overflow: auto;
  padding: 6px;
  font-size: 14px;
}

.popover.app-menu::backdrop { background: transparent; }

.app-menu__label {
  padding: 6px 10px 4px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.app-menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  text-align: left;
}

.app-menu__item:hover,
.app-menu__item:focus-visible { background: var(--surface-3); outline: none; }
.app-menu__item .icon { color: var(--text-2); }
.app-menu__check { margin-left: auto; visibility: hidden; }
.app-menu__item[aria-checked="true"] .app-menu__check { visibility: visible; color: var(--accent); }


/* ---------- 12. Animations ---------------------------------------------- */

@keyframes fade-in { from { opacity: 0; } }
@keyframes rise-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes slide-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes stripes { to { background-position: 18px 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes bob { to { transform: translateY(-5px); } }
@keyframes draw { from { stroke-dashoffset: 60; } }

@keyframes stamp-in {
  0%   { opacity: 0; transform: rotate(-16deg) scale(2.1); }
  55%  { opacity: 1; transform: rotate(-3deg) scale(.9); }
  75%  { transform: rotate(-5deg) scale(1.04); }
  100% { transform: rotate(-4deg) scale(1); }
}

@keyframes fp-in {
  from { opacity: 0; transform: scale(.6) rotate(-20deg); }
}

@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-4deg) scale(1.06); }
  60% { transform: rotate(3deg); }
}

/* Pas de transitions avant le demarrage de l'appli (reglages memorises appliques
   d'un coup, sans animation) */
:root:not(.is-ready) *,
:root:not(.is-ready) *::before,
:root:not(.is-ready) *::after {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ---------- 13. Ecrans etroits ------------------------------------------ */

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr) 310px; gap: 22px; padding: 24px 20px 16px; }
}

/* Seuils de la barre du haut choisis par mesure (2026-11-25, Edge, 300 a 1300 px) :
   sous-titre entier jusqu'a 910 px, libelles des boutons jusqu'a 700 px, barre
   complete en icones jusqu'a 420 px ; environ 30 px de marge. */
@media (max-width: 940px) {
  .brand__tag { display: none; }
}

/* Une seule colonne : fiches, puis verification et reglages, puis "Bon a savoir" */
@media (max-width: 919px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "work" "side" "about";
    gap: 18px;
  }
  .side {
    position: static;
    max-height: none;
    overflow: visible;
    margin: 0;
    padding: 0;
  }
  .features { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 730px) {
  .topbar__actions .btn__label { display: none; }
  .topbar__actions .btn { width: 36px; padding: 0; }
}

@media (max-width: 600px) {
  .layout { padding: 16px 12px 12px; gap: 16px; }
  .topbar { padding: 0 10px 0 12px; gap: 10px; }
  .dropzone { padding: 22px 14px 20px; }
  .dropzone__art { width: 170px; height: 109px; }
  .dropzone__actions .btn { flex: 1 1 auto; }
  .card { padding: 12px 12px 10px; }
  .card__icon { width: 34px; height: 34px; }
  .hashes { margin: 10px -4px 0; }
  .hash { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 2px 6px 6px; }
  .hash__algo { grid-column: 1; }
  .hash__value { grid-column: 1; grid-row: 2; }
  .hash .icon-btn { grid-column: 2; grid-row: 1 / span 2; }
  .panel { padding: 14px 14px 16px; }
  .about details p { padding-left: 4px; }
  .toasts { bottom: 12px; }
  .add-row button { padding: 0 10px; }
  .add-row__alt span { display: none; }
}

/* Barre du haut etroite (seuil choisi par mesure, voir deploiement/LISEZMOI.md) :
   l'icone Barbatools, les raccourcis et le theme quittent la barre ; le chevron a
   cote du logo ouvre un menu avec le theme, les raccourcis, puis Barbatools et
   les autres outils. Les actions (fichiers, texte, exporter) restent. */
@media (max-width: 450px) {
  .barba-desktop,
  #btn-help,
  #btn-theme,
  .topbar__sep { display: none; }
  .brand__menu { display: inline-grid; }
}

@media (min-width: 451px) {
  .popover.app-menu { display: none; }
}

@media (max-width: 380px) {
  .card__head { gap: 9px; }
  .card__actions .icon-btn { width: 28px; }
  .stamp { padding: 2px 6px; letter-spacing: .05em; }
}
