/* OrethraX.AI : thème sombre, composition éditoriale */
:root {
  --bg: #101114;
  --bg-2: #17191e;
  --raised: #1e2026;
  --line: #30323a;
  --thumb: #454852; /* barre de défilement */
  --text: #eceef2;
  --text-2: #a0a4ae;
  --text-3: #777d89;
  --accent: #8da6c9;
  --on-accent: #101114;
  /* états uniquement */
  --ok: #5cc08c;
  --warn: #e0b64a;
  --err: #e0644f;
  /* échelle d'arrondis */
  --r-1: 2px;
  --r-2: 6px;
  --r-3: 10px;
  --font: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--thumb) transparent;
}
html,
body {
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Barre de défilement : fine, sans flèches (anciens navigateurs WebKit) */
@supports not (scrollbar-color: auto) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-thumb {
    background: var(--thumb);
    border-radius: var(--r-1);
  }
  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-3);
  }
  ::-webkit-scrollbar-button,
  ::-webkit-scrollbar-corner {
    display: none;
  }
}

.app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- barre du haut ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 600;
}
.app.start .brand {
  visibility: hidden;
}
.nav-btn {
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font: 500 0.75rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.nav-btn:hover {
  color: var(--text);
  border-bottom-color: var(--text-2);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-2);
  background: none;
  color: var(--text-2);
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.icon-btn:hover {
  background: var(--raised);
  color: var(--text);
}
.icon-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- accueil ---------- */
.hero {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}
.app.started .hero {
  display: none;
}
.hero-logo {
  width: clamp(88px, 24vw, 120px);
  margin-bottom: 18px;
  mix-blend-mode: screen;
}
.hero-sub {
  max-width: 40ch;
  margin-inline: auto;
  color: var(--text-2);
}
.eyebrow {
  color: var(--text-2);
  font: 400 0.75rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.greeting {
  font-size: clamp(1.9rem, 5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.auth-help {
  color: var(--text-3);
  font-size: 0.85rem;
  text-align: center;
  overflow-wrap: anywhere;
}
.auth-help a {
  color: var(--accent);
}
/* ---------- tiroir des conversations ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer {
  position: fixed;
  z-index: 10;
  inset: 0 auto 0 0;
  width: min(86vw, 320px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px
    calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  transform: translateX(-102%);
  visibility: hidden;
  transition:
    transform 0.25s ease,
    visibility 0s 0.25s;
}
.app.history-open .drawer {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}
.app.history-open .backdrop {
  opacity: 1;
  pointer-events: auto;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-title {
  color: var(--text-2);
  font: 500 0.75rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.new-chat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.new-chat:hover {
  border-color: var(--accent);
}
.conversation-list {
  flex: 1;
  overflow-y: auto;
}
.conversation-empty {
  padding: 12px 0;
  color: var(--text-2);
  font-size: 0.9rem;
}
.conv-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.conv-row:hover {
  background: var(--raised);
}
.conv-row.active {
  background: var(--raised);
  box-shadow: inset 2px 0 0 var(--accent);
}
.conv-title {
  flex: 1;
  min-width: 0;
  padding: 12px 10px 12px 12px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 0.95rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}
.conv-row:hover .conv-title,
.conv-row.active .conv-title {
  color: var(--text);
}
.conv-actions {
  display: flex;
  padding-right: 4px;
}
.mini-btn {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: var(--text-3);
  cursor: pointer;
}
.mini-btn:hover {
  background: var(--line);
  color: var(--text);
}
.mini-btn.danger:hover {
  color: var(--err);
}
.mini-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.conv-edit {
  flex: 1;
  min-width: 0;
  margin: 4px;
  padding: 6px 8px;
  border: 1px solid var(--accent);
  border-radius: var(--r-2);
  background: var(--bg);
  outline: none;
}
.drawer-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.drawer-username {
  flex: 1 1 100%;
  min-width: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  overflow-wrap: anywhere;
  /* 2 lignes maximum pour les noms très longs */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drawer-user .logout-btn {
  flex: 1 1 auto;
}
.logout-btn {
  flex-shrink: 0;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: none;
  font-size: 0.85rem;
  cursor: pointer;
}
.logout-btn:hover {
  border-color: var(--text-2);
}

/* ---------- conversation ---------- */
.chat {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 20px;
}
.app.started .chat {
  display: flex;
}
.bubble {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bubble.user {
  align-self: flex-end;
  max-width: min(85%, 560px);
  padding: 10px 14px;
  background: var(--raised);
  border-radius: var(--r-2);
}
.bubble.ai {
  align-self: stretch;
  padding-left: 16px;
  border-left: 1px solid var(--line);
  line-height: 1.65;
}
.bubble.error {
  color: var(--err);
  border-left-color: var(--err);
}
.bubble img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin-bottom: 8px;
  border-radius: var(--r-2);
}
.bubble audio {
  display: block;
  width: 100%;
  max-width: 280px;
  height: 40px;
  margin-bottom: 8px;
  color-scheme: dark; /* lecteur sombre au lieu du lecteur blanc par défaut */
  border-radius: 999px;
}
/* Transcription d'un message vocal, sous le lecteur */
.transcript {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.9rem;
  line-height: 1.5;
}
.transcript-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-3);
  font: 400 0.68rem var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.bubble audio + .transcript {
  margin-top: 0;
}
.pdf-chip,
.retry-btn {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: none;
  color: var(--accent);
  font: 400 0.85rem var(--mono);
  text-decoration: none;
  cursor: pointer;
}
.retry-btn {
  margin: 8px 0 0;
  color: inherit;
}

/* Bouton « Copier » : visible au survol de la réponse (toujours visible sur écran tactile) */
.copy-btn {
  display: block;
  margin-top: 10px;
  padding: 2px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  color: var(--text-2);
  font: 400 0.72rem var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}
.bubble.ai:hover .copy-btn,
.copy-btn:focus-visible {
  opacity: 1;
}
.copy-btn:hover {
  color: var(--text);
  border-bottom-color: var(--text-2);
}
@media (hover: none) {
  .copy-btn {
    opacity: 1;
  }
}

/* Réponses mises en forme */
.bubble.ai .md {
  white-space: normal;
}
.md p {
  margin: 0 0 0.8em;
}
.md > :last-child {
  margin-bottom: 0;
}
.md ul,
.md ol {
  margin: 0 0 0.8em;
  padding-left: 1.3em;
}
.md li {
  margin: 0.25em 0;
}
.md h4 {
  margin: 1.1em 0 0.4em;
  font-size: 1rem;
  font-weight: 600;
}
.md code {
  padding: 1px 5px;
  border-radius: var(--r-1);
  background: var(--raised);
  font: 400 0.875em var(--mono);
}
.md pre {
  margin: 0 0 0.9em;
  padding: 12px 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-2);
  line-height: 1.5;
}
.md pre code {
  padding: 0;
  background: none;
}

/* Réflexion : vert, puis jaune, puis rouge si l'attente se prolonge (16 s) */
.typing-bubble {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.typing-status {
  color: var(--text-2);
  font: 400 0.82rem var(--mono);
}
.activity {
  margin: 0 0 8px;
  color: var(--text-2);
  font: 400 0.78rem var(--mono);
}
.sources {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.sources a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  font: 400 0.75rem var(--mono);
  text-decoration: none;
}
.sources a:hover {
  border-color: var(--text-2);
}
.source-site {
  flex: none;
  color: var(--accent);
  font-weight: 500;
}
.source-title {
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sources a:hover .source-title {
  color: var(--text);
}

.typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--ok);
  animation:
    pulse 1.2s infinite,
    heat 16s linear forwards;
}
.typing i:nth-child(2) {
  animation-delay: 0.2s, 0s;
}
.typing i:nth-child(3) {
  animation-delay: 0.4s, 0s;
}
@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1.1);
  }
}
@keyframes heat {
  0% {
    background-color: var(--ok);
  }
  35% {
    background-color: var(--warn);
  }
  70%,
  100% {
    background-color: var(--err);
  }
}

/* ---------- saisie ---------- */
.composer-wrap {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 20px 20px;
}
.app.start {
  justify-content: center;
}
.app.start .topbar {
  position: absolute;
  inset: env(safe-area-inset-top, 0px) 0 auto 0;
  border-bottom-color: transparent;
}
.app.start .composer-wrap {
  margin-top: 28px;
}
.composer {
  padding: 10px 12px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  transition: border-color 0.15s;
}
.composer:focus-within {
  border-color: var(--accent);
}
.composer textarea {
  width: 100%;
  max-height: 160px;
  padding: 6px 4px;
  border: 0;
  background: transparent;
  resize: none;
  outline: none;
}
.composer textarea::placeholder {
  color: var(--text-3);
}
.actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.spacer {
  flex: 1;
}
.send {
  background: var(--accent);
  color: var(--on-accent);
}
.send:hover {
  background: var(--accent);
  color: var(--on-accent);
  filter: brightness(1.1);
}
.send.stop {
  background: var(--err);
}
/* Bouton « recherche internet » : accent quand activé, globe barré quand désactivé */
.icon-btn.toggle[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}
.icon-btn.toggle[aria-pressed="true"]:hover {
  filter: brightness(1.1);
}
.icon-btn .web-off {
  display: none;
}
.icon-btn.toggle[aria-pressed="false"] .web-off {
  display: block;
}
.icon-btn.recording {
  background: var(--err);
  color: var(--bg);
  animation: rec 1s infinite;
}
@keyframes rec {
  50% {
    opacity: 0.6;
  }
}
.attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 6px;
  padding: 3px 4px 3px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  font-size: 0.85rem;
}
.attachment[hidden] {
  display: none;
}
.attachment span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.attachment button {
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- connexion ---------- */
.auth {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--bg);
  overflow-y: auto;
}
.auth[hidden] {
  display: none;
}
.auth-card {
  width: min(100%, 380px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-logo {
  width: 64px;
  mix-blend-mode: screen;
}
.auth-title {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.auth-lead {
  margin-top: -8px;
  color: var(--text-2);
  font-size: 0.95rem;
}
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  flex: 1;
  margin-bottom: -1px;
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}
#authForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-2);
  font-size: 0.85rem;
}
.auth-field[hidden] {
  display: none;
}
.auth-field input {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg-2);
  font-size: 1rem;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--accent);
}
.auth-error {
  min-height: 1.2em;
  color: var(--err);
  font-size: 0.9rem;
}
.auth-submit {
  padding: 11px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  cursor: pointer;
}
.auth-submit:hover {
  filter: brightness(1.1);
}
.auth-submit[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.password-wrap {
  position: relative;
  display: flex;
}
.password-wrap input {
  width: 100%;
  padding-right: 44px;
}
.eye-btn {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: var(--text-2);
  cursor: pointer;
}
.eye-btn:hover {
  background: var(--raised);
  color: var(--text);
}
.eye-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.eye-btn .eye-slash {
  display: none;
}
.eye-btn.visible .eye-slash {
  display: block;
}

/* ---------- « Ma mémoire » ---------- */
.memory-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}
.memory-panel {
  width: min(480px, 100%);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.memory-panel h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.memory-hint,
.memory-empty {
  color: var(--text-2);
  font-size: 0.85rem;
}
.memory-list {
  overflow-y: auto;
  border-top: 1px solid var(--line);
}
.memory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.memory-del {
  flex-shrink: 0;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--r-1);
  background: none;
  color: var(--err);
  cursor: pointer;
}
.memory-del:hover {
  background: var(--raised);
}
.memory-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.memory-danger,
.memory-close {
  padding: 8px 14px;
  border-radius: var(--r-2);
  cursor: pointer;
}
.memory-danger {
  border: 1px solid var(--err);
  background: none;
  color: var(--err);
}
.memory-close {
  border: 1px solid var(--line);
  background: var(--raised);
}

@media (max-width: 480px) {
  .topbar,
  .hero,
  .chat,
  .composer-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bubble.user {
    max-width: 92%;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
  .typing i {
    animation: heat 16s linear forwards; /* plus de pulsation, la couleur reste */
  }
  .icon-btn.recording {
    animation: none;
  }
}
/* Style pour le conteneur d'image et son bouton de téléchargement */
.image-bubble-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.download-img-btn {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg-2);
  color: var(--accent);
  font: 400 0.8rem var(--mono);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.download-img-btn:hover {
  background: var(--raised);
  color: var(--text);
}
/* --- Bouton de copie flottant sur les blocs de code --- */
.code-block-wrapper {
  position: relative;
  margin: 0 0 0.9em;
}
.code-block-wrapper pre {
  margin: 0;
}
.code-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-1);
  background: var(--bg);
  color: var(--text-2);
  font: 400 0.7rem var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s,
    background 0.15s;
}
.code-block-wrapper:hover .code-copy-btn {
  opacity: 1;
}
.code-copy-btn:hover {
  background: var(--raised);
  color: var(--text);
}

/* --- Bouton de retour client dans le tiroir --- */
.drawer-feedback {
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.feedback-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: none;
  color: var(--text-2);
  font-size: 0.9rem;
  cursor: pointer;
  transition:
    border-color 0.15s,
    color 0.15s;
}
.feedback-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* --- Fenêtre modale de feedback --- */
.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.6);
}
.feedback-card {
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.feedback-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
}
.feedback-card textarea {
  width: 100%;
  height: 120px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  background: var(--bg);
  resize: none;
  outline: none;
}
.feedback-card textarea:focus {
  border-color: var(--accent);
}
.feedback-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.mini-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none; /* 🟢 Ajoute cette ligne */
}
@media (hover: none) {
  .code-copy-btn {
    opacity: 1;
  }
}
.quota-note {
  margin: 0 0 8px;
  font-size: 12px;
  text-align: center;
  color: #8da6c9;
}
/* --- Barre de progression de la pièce jointe --- */
.attachment-progress-container {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
  display: none;
}
.attachment-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}
.install-banner {
  position: fixed;
  z-index: 8;
  top: calc(64px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 420px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.install-banner[hidden],
.app.started .install-banner {
  display: none; /* visible seulement sur l'écran d'accueil */
}
.install-banner img {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--r-2);
}
.install-banner p {
  flex: 1;
  min-width: 0;
  color: var(--text-2);
  font-size: 0.85rem;
}
#installBtn {
  padding: 6px 12px;
  border: 0;
  border-radius: var(--r-2);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 500;
  cursor: pointer;
}
#installClose {
  border: 0;
  background: none;
  color: var(--text-2);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
