/* BizzNoir Assistant — interface isolée du reste du site. */

.assistant-nav-button {
  appearance: none;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid rgba(202, 92, 59, .2);
  border-radius: 999px;
  background: rgba(202, 92, 59, .08);
  color: var(--terracotta-dark, #a7462d);
  font: 700 13px/1 var(--font-body, "Inter", sans-serif);
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.assistant-nav-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-nav-button:hover,
.assistant-nav-button:focus-visible {
  color: #fff;
  background: var(--terracotta, #c85c3b);
  border-color: var(--terracotta, #c85c3b);
  transform: translateY(-1px);
}

.assistant-nav-button:focus-visible,
.assistant-floating-button:focus-visible,
.assistant-close-button:focus-visible,
.assistant-suggestions button:focus-visible,
.assistant-composer button:focus-visible,
.assistant-action:focus-visible,
.assistant-business-card:focus-visible {
  outline: 3px solid rgba(202, 92, 59, .28);
  outline-offset: 3px;
}

.assistant-floating-button {
  position: fixed;
  right: clamp(18px, 2.2vw, 34px);
  bottom: clamp(18px, 2.2vw, 34px);
  z-index: 920;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 19px 8px 8px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  background: #111827;
  color: #fff;
  box-shadow: 0 20px 55px rgba(17, 24, 39, .24);
  font: 700 14px/1 var(--font-body, "Inter", sans-serif);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.assistant-floating-button:hover {
  background: #1e293b;
  box-shadow: 0 24px 65px rgba(17, 24, 39, .32);
  transform: translateY(-3px);
}

.assistant-floating-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #db7958, #b34c31);
}

.assistant-floating-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-layer[hidden] {
  display: none !important;
}

.assistant-layer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  justify-items: end;
}

.assistant-layer.is-opening .assistant-backdrop {
  animation: assistant-fade-in .22s ease both;
}

.assistant-layer.is-opening .assistant-panel {
  animation: assistant-slide-in .28s cubic-bezier(.2, .75, .25, 1) both;
}

.assistant-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(10, 18, 31, .48);
  backdrop-filter: blur(5px);
  cursor: default;
}

.assistant-panel {
  position: relative;
  width: min(460px, 100vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, .55);
  background:
    radial-gradient(circle at 100% 0, rgba(202, 92, 59, .12), transparent 31%),
    #fbf8f3;
  box-shadow: -28px 0 80px rgba(15, 23, 42, .2);
  color: #111827;
}

.assistant-header {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(211, 202, 190, .75);
  background: rgba(255, 255, 255, .74);
}

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

.assistant-mark {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #111827;
  color: #fff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, .16);
}

.assistant-mark svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-kicker {
  margin: 0 0 3px;
  color: var(--terracotta-dark, #a7462d);
  font: 800 10px/1.2 var(--font-body, "Inter", sans-serif);
  letter-spacing: .16em;
  text-transform: uppercase;
}

.assistant-header h2 {
  margin: 0;
  color: #111827;
  font-family: var(--font-display, "Plus Jakarta Sans", sans-serif);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.035em;
}

.assistant-close-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid #ded6cb;
  border-radius: 50%;
  background: #fff;
  color: #111827;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.assistant-close-button:hover {
  background: #f1e9df;
  transform: rotate(4deg);
}

.assistant-close-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.assistant-status-bar {
  min-height: 43px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(211, 202, 190, .62);
  background: rgba(244, 237, 228, .72);
}

.assistant-status-bar > span {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #34845d;
  box-shadow: 0 0 0 4px rgba(52, 132, 93, .12);
}

.assistant-root-not-ready .assistant-status-bar > span {
  background: #b7791f;
  box-shadow: 0 0 0 4px rgba(183, 121, 31, .12);
}

.assistant-status-bar p,
.assistant-status-bar small {
  margin: 0;
  font-family: var(--font-body, "Inter", sans-serif);
}

.assistant-status-bar p {
  color: #475569;
  font-size: 12px;
  font-weight: 650;
}

.assistant-status-bar small {
  margin-left: auto;
  color: #8b796b;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.assistant-messages {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 21px 18px;
  scrollbar-width: thin;
  scrollbar-color: #cfc3b5 transparent;
}

.assistant-message {
  width: 100%;
  display: flex;
  align-items: flex-end;
  gap: 9px;
}

.assistant-message-user {
  justify-content: flex-end;
}

.assistant-avatar {
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font: 800 9px/1 var(--font-body, "Inter", sans-serif);
  letter-spacing: -.03em;
}

.assistant-message-content {
  max-width: calc(100% - 52px);
  padding: 13px 15px;
  border: 1px solid #e0d8ce;
  border-radius: 18px 18px 18px 5px;
  background: #fff;
  box-shadow: 0 8px 26px rgba(34, 42, 55, .055);
}

.assistant-message-user .assistant-message-content {
  border-color: #b75034;
  border-radius: 18px 18px 5px 18px;
  background: linear-gradient(145deg, #cb6646, #b44f34);
  color: #fff;
  box-shadow: 0 10px 28px rgba(180, 79, 52, .18);
}

.assistant-message-content p {
  margin: 0;
  color: inherit;
  font: 400 14px/1.6 var(--font-body, "Inter", sans-serif);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.assistant-message-error .assistant-message-content {
  border-color: #e8b2a5;
  background: #fff3ef;
  color: #8f3826;
}

.assistant-business-list {
  width: calc(100% - 40px);
  align-self: flex-end;
  display: grid;
  gap: 9px;
  margin-top: -8px;
}

.assistant-business-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 13px;
  align-items: center;
  padding: 14px;
  border: 1px solid #ded4c8;
  border-radius: 15px;
  background: rgba(255, 255, 255, .84);
  color: #111827;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.assistant-business-card:hover {
  border-color: rgba(202, 92, 59, .55);
  box-shadow: 0 12px 28px rgba(34, 42, 55, .09);
  transform: translateY(-2px);
}

.assistant-business-card strong {
  display: block;
  margin-bottom: 3px;
  font: 750 14px/1.25 var(--font-display, "Plus Jakarta Sans", sans-serif);
}

.assistant-business-card p,
.assistant-business-card small {
  margin: 0;
  color: #68707d;
  font-family: var(--font-body, "Inter", sans-serif);
}

.assistant-business-card p {
  grid-column: 1 / -1;
  display: -webkit-box;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.assistant-business-card small {
  font-size: 11px;
  font-weight: 600;
}

.assistant-business-arrow {
  width: 30px;
  height: 30px;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f3e7df;
  color: #a7462d;
  font-size: 16px;
}

.assistant-actions {
  width: calc(100% - 40px);
  align-self: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -8px;
}

.assistant-action {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid #cbbfb1;
  border-radius: 999px;
  background: #fff;
  color: #263244;
  font: 700 11px/1.2 var(--font-body, "Inter", sans-serif);
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.assistant-action:hover {
  border-color: #c85c3b;
  background: #f7e8e2;
  color: #a7462d;
}

.assistant-typing .assistant-message-content {
  display: flex;
  gap: 5px;
  padding-block: 17px;
}

.assistant-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9a8b7c;
  animation: assistant-dot 1.05s ease-in-out infinite;
}

.assistant-typing i:nth-child(2) {
  animation-delay: .14s;
}

.assistant-typing i:nth-child(3) {
  animation-delay: .28s;
}

.assistant-suggestions {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 7px 20px 13px;
  scrollbar-width: none;
}

.assistant-suggestions::-webkit-scrollbar {
  display: none;
}

.assistant-suggestions button {
  flex: 0 0 auto;
  min-height: 35px;
  padding: 7px 12px;
  border: 1px solid #d7ccc0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: #394252;
  font: 650 11px/1.2 var(--font-body, "Inter", sans-serif);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.assistant-suggestions button:hover {
  border-color: rgba(202, 92, 59, .58);
  background: #f7e8e2;
  color: #9f432d;
}

.assistant-composer {
  padding: 15px 20px 17px;
  border-top: 1px solid rgba(211, 202, 190, .8);
  background: rgba(255, 255, 255, .86);
}

.assistant-composer > label {
  display: block;
  margin-bottom: 7px;
  color: #293142;
  font: 750 12px/1.2 var(--font-body, "Inter", sans-serif);
}

.assistant-input-row {
  min-height: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: end;
  padding: 6px 6px 6px 14px;
  border: 1px solid #d7cec3;
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 24px rgba(34, 42, 55, .055);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.assistant-input-row.has-microphone {
  grid-template-columns: minmax(0, 1fr) 42px 42px;
}

.assistant-input-row:focus-within {
  border-color: #c85c3b;
  box-shadow: 0 0 0 4px rgba(202, 92, 59, .1);
}

.assistant-input-row textarea {
  width: 100%;
  max-height: 130px;
  min-height: 40px;
  resize: none;
  overflow-y: auto;
  align-self: center;
  padding: 9px 0 7px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: 400 14px/1.45 var(--font-body, "Inter", sans-serif);
}

.assistant-input-row textarea::placeholder {
  color: #9297a0;
}

.assistant-input-row button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 13px;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, opacity .18s ease;
}

.assistant-input-row button[data-assistant-submit] {
  background: #c85c3b;
  color: #fff;
}

.assistant-input-row button[data-assistant-submit]:hover {
  background: #a7462d;
  transform: translateY(-1px);
}

.assistant-microphone-button {
  border-color: #dfd4c9 !important;
  background: #f6f0eb;
  color: #303a4c;
}

.assistant-microphone-button:hover {
  border-color: rgba(200, 92, 59, .55) !important;
  background: #f7e5de;
  color: #a7462d;
  transform: translateY(-1px);
}

.assistant-microphone-button.is-listening {
  border-color: #c85c3b !important;
  background: #c85c3b;
  color: #fff;
  animation: assistant-microphone-pulse 1.4s ease-out infinite;
}

.assistant-microphone-button.is-transcribing {
  border-color: #dfd4c9 !important;
  background: #eee8e1;
  color: #7b746e;
}

.assistant-input-row button[hidden] {
  display: none !important;
}

.assistant-input-row button:disabled {
  opacity: .5;
  cursor: wait;
  transform: none;
}

.assistant-input-row button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.assistant-voice-status {
  margin: 7px 3px 0;
  color: #687181;
  font: 500 10px/1.45 var(--font-body, "Inter", sans-serif);
}

.assistant-voice-status.is-active {
  color: #a7462d;
}

.assistant-voice-status.is-success {
  color: #3d795b;
}

.assistant-voice-status.is-error {
  color: #9b3e2d;
}

.assistant-composer-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
}

.assistant-composer-meta p,
.assistant-composer-meta span {
  margin: 0;
  color: #7c818a;
  font: 400 9px/1.45 var(--font-body, "Inter", sans-serif);
}

.assistant-composer-meta span {
  font-variant-numeric: tabular-nums;
}

body.assistant-open {
  overflow: hidden;
}

body.assistant-open .assistant-floating-button {
  opacity: 0;
  pointer-events: none;
}

@keyframes assistant-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes assistant-slide-in {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes assistant-dot {
  0%, 60%, 100% { opacity: .35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@keyframes assistant-microphone-pulse {
  0% { box-shadow: 0 0 0 0 rgba(200, 92, 59, .34); }
  70% { box-shadow: 0 0 0 8px rgba(200, 92, 59, 0); }
  100% { box-shadow: 0 0 0 0 rgba(200, 92, 59, 0); }
}

@media (max-width: 1220px) {
  .assistant-nav-button span {
    display: none;
  }

  .assistant-nav-button {
    width: 40px;
    justify-content: center;
    padding-inline: 0;
  }
}

@media (max-width: 960px) {
  .main-nav .assistant-nav-button {
    width: 100%;
    min-height: 48px;
    justify-content: flex-start;
    gap: 10px;
    margin: 7px 0;
    padding: 10px 12px;
    border-radius: 10px;
  }

  .main-nav .assistant-nav-button span {
    display: inline;
  }
}

@media (max-width: 600px) {
  .assistant-floating-button {
    min-width: 54px;
    min-height: 54px;
    right: 14px;
    bottom: 14px;
    padding: 7px;
  }

  .assistant-floating-button > span:last-child {
    display: none;
  }

  .assistant-floating-icon {
    width: 40px;
    height: 40px;
  }

  .assistant-panel {
    width: 100vw;
    border-left: 0;
  }

  .assistant-header {
    min-height: 84px;
    padding: 16px;
  }

  .assistant-mark {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .assistant-header h2 {
    font-size: 20px;
  }

  .assistant-status-bar {
    padding-inline: 17px;
  }

  .assistant-messages {
    padding: 19px 15px 14px;
  }

  .assistant-message-content {
    max-width: calc(100% - 42px);
  }

  .assistant-business-list,
  .assistant-actions {
    width: calc(100% - 38px);
  }

  .assistant-suggestions {
    padding-inline: 15px;
  }

  .assistant-composer {
    padding: 12px 15px calc(13px + env(safe-area-inset-bottom));
  }

  .assistant-input-row.has-microphone {
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    gap: 6px;
  }

  .assistant-input-row button {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .assistant-layer *,
  .assistant-floating-button,
  .assistant-nav-button {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
