/* ==========================================================
   V9 P3 — ANGE GABRIELLE
   Widget conversationnel commun
   ========================================================== */

.ange-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10000;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ange-launcher {
  min-width: 184px;
  min-height: 58px;
  padding: 8px 13px 8px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  border: 1px solid rgba(118, 94, 68, .16);
  border-radius: 999px;
  background: #2b2824;
  color: #fff;
  box-shadow: 0 14px 40px rgba(31, 27, 23, .18);
  cursor: pointer;
}

.ange-launcher-mark,
.ange-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff9ef, #d9c7af);
  color: #4e4033;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .72rem;
  letter-spacing: .07em;
  box-shadow: inset 0 0 0 1px rgba(99, 77, 55, .12);
}

.ange-launcher-copy {
  display: grid;
  gap: 1px;
  text-align: left;
}

.ange-launcher-copy strong {
  font-size: .76rem;
}

.ange-launcher-copy small {
  color: rgba(255,255,255,.62);
  font-size: .58rem;
}

.ange-launcher-badge {
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  position: absolute;
  top: -4px;
  right: -2px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  border: 2px solid #f7f3ec;
  border-radius: 999px;
  background: #9b554c;
  color: #fff;
  font-size: .55rem;
  font-weight: 800;
}

.ange-panel {
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100dvh - 110px));
  position: absolute;
  right: 0;
  bottom: 70px;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto auto auto auto;
  overflow: hidden;
  border: 1px solid rgba(118, 94, 68, .16);
  border-radius: 22px;
  background: #fbf8f2;
  color: #2d2925;
  box-shadow: 0 24px 70px rgba(35, 30, 25, .22);
}

.ange-panel[hidden] {
  display: none !important;
}

.ange-header {
  min-height: 68px;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(118, 94, 68, .11);
  background: rgba(255,255,255,.76);
}

.ange-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ange-avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.ange-identity > span:last-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.ange-identity strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: .93rem;
  font-weight: 500;
}

.ange-identity small {
  overflow: hidden;
  color: #85796c;
  font-size: .56rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ange-header-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ange-icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(118, 94, 68, .10);
  border-radius: 50%;
  background: #f4eee6;
  color: #51483f;
  font-size: 1rem;
  cursor: pointer;
}

.ange-messages {
  min-height: 0;
  padding: 15px 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background:
    linear-gradient(
      180deg,
      rgba(247,242,234,.78),
      rgba(255,255,255,.44)
    );
}

.ange-message {
  max-width: 88%;
  display: grid;
  gap: 4px;
}

.ange-message-user {
  align-self: flex-end;
}

.ange-message-assistant {
  align-self: flex-start;
}

.ange-message-label {
  padding: 0 5px;
  color: #8e8275;
  font-size: .48rem;
}

.ange-message-user .ange-message-label {
  text-align: right;
}

.ange-message-body {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(118, 94, 68, .09);
  border-radius: 15px 15px 15px 5px;
  background: #eee7dd;
  color: #39332d;
  font-size: .68rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ange-message-user .ange-message-body {
  border-color: #2d2a26;
  border-radius: 15px 15px 5px 15px;
  background: #2d2a26;
  color: #fff;
}

.ange-message-body.is-loading {
  color: #817568;
  font-style: italic;
}

.ange-starters {
  padding: 9px 11px 5px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border-top: 1px solid rgba(118, 94, 68, .08);
  background: #fbf8f2;
}

.ange-starters::-webkit-scrollbar,
.ange-links::-webkit-scrollbar {
  display: none;
}

.ange-starter {
  padding: 7px 9px;
  flex: 0 0 auto;
  border: 1px solid rgba(118, 94, 68, .13);
  border-radius: 999px;
  background: #fff;
  color: #5e5449;
  font: inherit;
  font-size: .54rem;
  cursor: pointer;
}

.ange-links {
  padding: 4px 11px 8px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  background: #fbf8f2;
}

.ange-link {
  padding: 6px 8px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #eee6dc;
  color: #675849;
  font-size: .52rem;
  font-weight: 650;
  text-decoration: none;
}

.ange-form {
  padding: 9px 10px 7px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 7px;
  border-top: 1px solid rgba(118, 94, 68, .10);
  background: #fffdfa;
}

.ange-form textarea {
  width: 100%;
  min-height: 42px;
  max-height: 110px;
  height: 42px;
  padding: 10px 11px;
  box-sizing: border-box;
  resize: none;
  overflow-y: auto;
  border: 1px solid rgba(118, 94, 68, .15);
  border-radius: 12px;
  outline: 0;
  background: #f7f3ed;
  color: #2d2925;
  font: inherit;
  font-size: .67rem;
  line-height: 1.4;
}

.ange-form textarea:focus {
  border-color: rgba(145, 108, 70, .45);
  box-shadow: 0 0 0 3px rgba(145, 108, 70, .07);
}

.ange-form button {
  min-height: 42px;
  padding: 9px 13px;
  border: 0;
  border-radius: 12px;
  background: #2d2a26;
  color: #fff;
  font: inherit;
  font-size: .61rem;
  font-weight: 750;
  cursor: pointer;
}

.ange-form button:disabled,
.ange-form textarea:disabled {
  opacity: .58;
  cursor: wait;
}

.ange-disclaimer {
  margin: 0;
  padding: 0 12px 10px;
  background: #fffdfa;
  color: #9a8e81;
  font-size: .47rem;
  line-height: 1.35;
  text-align: center;
}

@media (max-width: 767px) {
  .ange-root {
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
  }

  .ange-launcher {
    min-width: 0;
    min-height: 54px;
    padding: 6px;
  }

  .ange-launcher-mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }

  .ange-launcher-copy {
    display: none;
  }

  .ange-panel {
    width: calc(100vw - 16px);
    height: min(72dvh, 660px);
    right: -2px;
    bottom: 64px;
    border-radius: 18px;
  }

  .ange-message {
    max-width: 92%;
  }

  .ange-message-body {
    font-size: .76rem;
  }

  .ange-starter {
    font-size: .59rem;
  }

  .ange-form textarea {
    min-height: 46px;
    height: 46px;
    font-size: 16px;
  }

  .ange-form button {
    min-height: 46px;
  }
}

@media (max-width: 380px) {
  .ange-panel {
    width: calc(100vw - 10px);
    right: -5px;
    height: min(78dvh, 680px);
  }

  .ange-header {
    padding-inline: 9px;
  }

  .ange-messages {
    padding-inline: 9px;
  }

  .ange-form {
    padding-inline: 8px;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  .ange-panel {
    width: min(430px, calc(100vw - 18px));
    height: calc(100dvh - 18px);
    right: 0;
    bottom: 0;
  }

  .ange-launcher {
    min-height: 48px;
  }

  .ange-launcher-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }
}

@media print {
  .ange-root {
    display: none !important;
  }
}


/* ==========================================================
   V9 P4 — ACTIONS CONFIRMÉES
   ========================================================== */

.ange-action-group {
  width: min(92%, 330px);
  align-self: flex-start;
  display: grid;
  gap: 7px;
}

.ange-action-heading {
  padding: 0 4px;
  color: #8b7967;
  font-size: .49rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.ange-action-card {
  padding: 11px;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(142, 104, 68, .18);
  border-radius: 14px;
  background: #fffaf3;
  box-shadow: 0 7px 20px rgba(53, 43, 34, .045);
}

.ange-action-copy {
  display: grid;
  gap: 4px;
}

.ange-action-copy strong {
  color: #3f372f;
  font-size: .64rem;
  line-height: 1.35;
}

.ange-action-copy p {
  margin: 0;
  color: #817467;
  font-size: .54rem;
  line-height: 1.45;
}

.ange-action-buttons {
  display: flex;
  gap: 6px;
}

.ange-action-buttons button {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 10px;
  font: inherit;
  font-size: .55rem;
  font-weight: 700;
  cursor: pointer;
}

.ange-action-confirm {
  border: 1px solid #2d2a26;
  background: #2d2a26;
  color: #fff;
}

.ange-action-cancel {
  border: 1px solid rgba(118, 94, 68, .14);
  background: #f1ebe3;
  color: #675c51;
}

.ange-action-buttons button:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 767px) {
  .ange-action-group {
    width: 94%;
  }

  .ange-action-copy strong {
    font-size: .72rem;
  }

  .ange-action-copy p {
    font-size: .62rem;
  }

  .ange-action-buttons button {
    min-height: 38px;
    font-size: .62rem;
  }
}
