:root {
  --dermax-ai-black: #090908;
  --dermax-ai-panel: #11100e;
  --dermax-ai-panel-2: #17140f;
  --dermax-ai-text: #f8f4ec;
  --dermax-ai-muted: #aaa298;
  --dermax-ai-gold: #d4a64e;
  --dermax-ai-gold-bright: #f1cb75;
  --dermax-ai-gold-deep: #7a4f16;
  --dermax-ai-line: rgba(221, 176, 89, .30);
  --dermax-ai-line-soft: rgba(221, 176, 89, .15);
  --dermax-ai-green: #54e98d;
  --dermax-ai-shadow: 0 30px 100px rgba(0,0,0,.58), 0 0 55px rgba(214,164,73,.16);
}

.dermax-ai, .dermax-ai * { box-sizing: border-box; }
.dermax-ai {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999999;
  color: var(--dermax-ai-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Robot */
.dermax-ai__robot {
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  isolation: isolate;
}
.dermax-ai__robot svg { position: relative; z-index: 2; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 4px 8px rgba(0,0,0,.35)); }
.dermax-ai__robot-glow {
  position: absolute;
  z-index: 0;
  inset: 8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,198,106,.55) 0%, rgba(203,144,48,.23) 42%, transparent 72%);
  filter: blur(7px);
  animation: dermaxRobotAura 2.6s ease-in-out infinite;
}
.dermax-ai__robot::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgba(240,198,112,.56);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(240,198,112,.16), 0 0 16px rgba(240,198,112,.2);
}
.dermax-ai__robot-eye { filter: drop-shadow(0 0 4px rgba(255,216,121,.95)); animation: dermaxRobotEyes 2.1s ease-in-out infinite; }
.dermax-ai__robot--launcher { width: 52px; height: 52px; }
.dermax-ai__robot--header { width: 58px; height: 58px; }
.dermax-ai__robot--message { width: 36px; height: 36px; margin-top: 2px; }

/* Launcher */
.dermax-ai__launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 248px;
  min-height: 66px;
  padding: 7px 13px 7px 7px;
  border: 1px solid rgba(242,198,103,.7);
  border-radius: 999px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(31,27,21,.98), rgba(10,10,9,.99));
  color: #fff;
  box-shadow: 0 15px 45px rgba(0,0,0,.38), 0 0 22px rgba(220,168,74,.20), inset 0 0 22px rgba(255,210,119,.035);
  cursor: pointer;
  font: 650 15px/1 Inter, ui-sans-serif, sans-serif;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.dermax-ai__launcher::before {
  content: "";
  position: absolute;
  inset: -80% -30%;
  background: linear-gradient(115deg, transparent 42%, rgba(255,220,151,.19) 50%, transparent 58%);
  transform: translateX(-62%);
  animation: dermaxLauncherShine 4.8s ease-in-out infinite;
  pointer-events: none;
}
.dermax-ai__launcher:hover { transform: translateY(-3px); border-color: rgba(255,216,132,.95); box-shadow: 0 18px 52px rgba(0,0,0,.46), 0 0 34px rgba(225,171,72,.32); }
.dermax-ai__launcher-divider { width: 1px; align-self: stretch; margin: 8px 0; background: linear-gradient(transparent, rgba(227,184,101,.45), transparent); }
.dermax-ai__launcher-label { position: relative; z-index: 2; flex: 1; text-align: left; white-space: nowrap; letter-spacing: -.1px; }
.dermax-ai__launcher-arrow { position: relative; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(218,170,81,.42); border-radius: 50%; color: var(--dermax-ai-gold-bright); font: 300 26px/1 Georgia, serif; background: rgba(212,166,78,.06); transition: transform .22s ease, background .22s ease; }
.dermax-ai__launcher:hover .dermax-ai__launcher-arrow { transform: translateX(2px); background: rgba(212,166,78,.12); }

/* Panel */
.dermax-ai__panel {
  position: absolute;
  right: 0;
  bottom: 82px;
  width: min(440px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 125px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(235,192,102,.62);
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% -8%, rgba(209,157,63,.12), transparent 28%),
    radial-gradient(circle at 104% 24%, rgba(141,93,27,.12), transparent 30%),
    linear-gradient(180deg, rgba(19,17,14,.985), rgba(8,8,7,.995));
  box-shadow: var(--dermax-ai-shadow), inset 0 0 0 1px rgba(255,229,177,.035);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(.982);
  transform-origin: bottom right;
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
.dermax-ai__panel::before {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 22px rgba(237,191,101,.065);
}
.dermax-ai__panel.is-open { opacity: 1; visibility: visible; transform: none; }
.dermax-ai__ambient { position: absolute; z-index: 0; pointer-events: none; border: 1px solid rgba(216,169,80,.06); border-radius: 50%; }
.dermax-ai__ambient--one { width: 420px; height: 160px; right: -250px; top: 112px; transform: rotate(-20deg); box-shadow: 0 0 35px rgba(214,165,73,.04); }
.dermax-ai__ambient--two { width: 520px; height: 190px; left: -310px; bottom: 160px; transform: rotate(15deg); }

.dermax-ai__header {
  position: relative;
  z-index: 2;
  min-height: 94px;
  padding: 16px 17px 15px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--dermax-ai-line-soft);
  background: linear-gradient(180deg, rgba(25,22,18,.74), rgba(13,12,10,.28));
}
.dermax-ai__brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.dermax-ai__brand-copy { min-width: 0; }
.dermax-ai__brand strong {
  display: block;
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .1px;
  color: #fff8eb;
}
.dermax-ai__status { margin-top: 6px; display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.58); font-size: 11px; white-space: nowrap; }
.dermax-ai__status i { width: 8px; height: 8px; border-radius: 50%; background: var(--dermax-ai-green); box-shadow: 0 0 9px rgba(84,233,141,.72); animation: dermaxOnline 2s ease-in-out infinite; }
.dermax-ai__status b { color: rgba(255,255,255,.24); font-weight: 400; }
.dermax-ai__header-actions { display: flex; gap: 7px; }
.dermax-ai__header-actions button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.07); border-radius: 50%; background: rgba(255,255,255,.025); color: rgba(255,255,255,.72); cursor: pointer; font-size: 22px; line-height: 1; transition: border-color .18s ease, color .18s ease, background .18s ease, transform .18s ease; }
.dermax-ai__header-actions button:hover { border-color: rgba(223,176,87,.32); background: rgba(211,162,72,.08); color: var(--dermax-ai-gold-bright); transform: translateY(-1px); }

/* Messages */
.dermax-ai__body {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 26px 18px 18px;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: rgba(207,157,68,.30) transparent;
}
.dermax-ai__body::-webkit-scrollbar { width: 6px; }
.dermax-ai__body::-webkit-scrollbar-thumb { background: rgba(207,157,68,.26); border-radius: 999px; }
.dermax-ai__message { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 16px; }
.dermax-ai__message--user { justify-content: flex-end; }
.dermax-ai__message-avatar { flex: 0 0 auto; }
.dermax-ai__bubble {
  max-width: 82%;
  padding: 13px 15px;
  border: 1px solid rgba(220,171,80,.30);
  border-radius: 18px 18px 18px 7px;
  background: linear-gradient(145deg, rgba(43,37,29,.76), rgba(24,22,18,.88));
  color: rgba(255,255,255,.88);
  box-shadow: 0 7px 26px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.025);
  font-size: 13.5px;
  line-height: 1.58;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.dermax-ai__message--user .dermax-ai__bubble {
  border-color: rgba(231,187,97,.58);
  border-radius: 18px 18px 7px 18px;
  background: linear-gradient(135deg, #d0a04a, #8d601f);
  color: #100e0b;
  font-weight: 520;
  box-shadow: 0 7px 24px rgba(110,69,15,.30);
}
.dermax-ai__message.is-transient .dermax-ai__bubble { color: rgba(255,255,255,.58); font-style: normal; }
.dermax-ai__message.is-transient .dermax-ai__bubble::after { content: ""; display: inline-block; width: 18px; height: 5px; margin-left: 7px; vertical-align: middle; background: radial-gradient(circle, var(--dermax-ai-gold-bright) 1.5px, transparent 2px) 0 50% / 6px 6px repeat-x; animation: dermaxTyping .9s linear infinite; }

/* Quick actions */
.dermax-ai__quick {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 18px 14px;
  border-top: 1px solid rgba(215,168,78,.09);
  background: linear-gradient(180deg, rgba(9,9,8,0), rgba(9,9,8,.72));
}
.dermax-ai__quick.is-hidden { display: none; }
.dermax-ai__quick button {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid rgba(218,169,77,.34);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255,255,255,.018);
  color: rgba(255,255,255,.84);
  cursor: pointer;
  font: 600 11.5px/1.2 Inter, ui-sans-serif, sans-serif;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease, color .18s ease;
}
.dermax-ai__quick button:hover { border-color: rgba(240,195,104,.72); background: rgba(214,164,72,.075); color: #fff4df; transform: translateY(-1px); }
.dermax-ai__quick-icon { flex: 0 0 auto; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: rgba(212,166,78,.08); color: var(--dermax-ai-gold-bright); }
.dermax-ai__quick-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* Composer */
.dermax-ai__composer {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin: 0 14px 0;
  padding: 7px 7px 7px 12px;
  border: 1px solid rgba(222,175,87,.34);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(23,21,18,.96), rgba(11,11,10,.98));
  box-shadow: inset 0 0 18px rgba(226,178,83,.025), 0 6px 22px rgba(0,0,0,.22);
}
.dermax-ai__composer:focus-within { border-color: rgba(239,194,103,.72); box-shadow: 0 0 0 3px rgba(212,166,78,.07), inset 0 0 20px rgba(227,177,79,.035); }
.dermax-ai__composer-spark { flex: 0 0 auto; width: 24px; height: 44px; display: grid; place-items: center; color: rgba(235,190,100,.72); }
.dermax-ai__composer-spark svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.dermax-ai__composer textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 118px; resize: none; border: 0; padding: 12px 3px 9px; outline: none; background: transparent; color: rgba(255,255,255,.88); font: 400 13.5px/1.45 Inter, ui-sans-serif, sans-serif; box-shadow: none; }
.dermax-ai__composer textarea::placeholder { color: rgba(255,255,255,.34); }
.dermax-ai__composer button { flex: 0 0 auto; width: 48px; height: 48px; display: grid; place-items: center; border: 1px solid rgba(255,222,155,.22); border-radius: 15px; background: linear-gradient(145deg, #e0ad51, #9b691f); color: #0c0b09; cursor: pointer; box-shadow: 0 5px 18px rgba(133,84,18,.32), inset 0 1px rgba(255,245,220,.28); transition: transform .18s ease, filter .18s ease, box-shadow .18s ease; }
.dermax-ai__composer button svg { width: 19px; height: 19px; fill: currentColor; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.dermax-ai__composer button:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 8px 22px rgba(157,102,24,.42), 0 0 18px rgba(219,169,76,.18); }
.dermax-ai__composer button:disabled, .dermax-ai__composer textarea:disabled { opacity: .5; cursor: not-allowed; }
.dermax-ai__notice { position: relative; z-index: 2; padding: 10px 16px 14px; color: rgba(255,255,255,.34); text-align: center; font-size: 9.5px; line-height: 1.4; }

/* Keep the visual premium in both site themes; only soften it slightly on light pages. */
body:not(.dark-mode) .dermax-ai__panel { box-shadow: 0 28px 90px rgba(16,12,7,.45), 0 0 50px rgba(201,146,49,.12); }

@keyframes dermaxRobotAura { 0%,100% { transform: scale(.92); opacity: .62; } 50% { transform: scale(1.13); opacity: 1; } }
@keyframes dermaxRobotEyes { 0%,100% { opacity: .72; filter: drop-shadow(0 0 3px rgba(255,216,121,.76)); } 50% { opacity: 1; filter: drop-shadow(0 0 7px rgba(255,216,121,1)); } }
@keyframes dermaxOnline { 0%,100% { box-shadow: 0 0 7px rgba(84,233,141,.55); } 50% { box-shadow: 0 0 14px rgba(84,233,141,.95); } }
@keyframes dermaxLauncherShine { 0%,62% { transform: translateX(-72%); opacity: 0; } 72% { opacity: 1; } 87%,100% { transform: translateX(72%); opacity: 0; } }
@keyframes dermaxTyping { from { transform: translateX(0); opacity: .48; } 50% { opacity: 1; } to { transform: translateX(6px); opacity: .48; } }

@media (max-width: 600px) {
  .dermax-ai { right: 12px; bottom: 12px; }
  .dermax-ai__launcher { min-width: 218px; min-height: 60px; padding: 6px 10px 6px 6px; }
  .dermax-ai__robot--launcher { width: 47px; height: 47px; }
  .dermax-ai__launcher-arrow { width: 32px; height: 32px; font-size: 23px; }
  .dermax-ai__panel { position: fixed; left: 8px; right: 8px; bottom: 8px; width: auto; height: min(760px, calc(100dvh - 16px)); border-radius: 24px; transform-origin: bottom center; }
  .dermax-ai__panel.is-open ~ .dermax-ai__launcher { visibility: hidden; }
  .dermax-ai__header { min-height: 88px; padding: 14px 13px; }
  .dermax-ai__robot--header { width: 52px; height: 52px; }
  .dermax-ai__brand strong { max-width: 190px; font-size: 17px; }
  .dermax-ai__status { font-size: 10px; }
  .dermax-ai__status b, .dermax-ai__status b + * { display: none; }
  .dermax-ai__header-actions { gap: 3px; }
  .dermax-ai__header-actions button { width: 34px; height: 34px; }
  .dermax-ai__body { padding: 20px 13px 12px; }
  .dermax-ai__quick { grid-template-columns: 1fr 1fr; gap: 7px; padding: 10px 12px 12px; }
  .dermax-ai__quick button { padding: 7px 9px; font-size: 10.5px; min-height: 44px; }
  .dermax-ai__quick-icon { width: 25px; height: 25px; }
  .dermax-ai__composer { margin: 0 10px; }
}

@media (max-width: 390px) {
  .dermax-ai__quick { grid-template-columns: 1fr; }
  .dermax-ai__status { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) {
  .dermax-ai__panel, .dermax-ai__launcher, .dermax-ai__launcher-arrow, .dermax-ai__composer button, .dermax-ai__quick button { transition: none !important; }
  .dermax-ai__robot-glow, .dermax-ai__robot-eye, .dermax-ai__status i, .dermax-ai__launcher::before, .dermax-ai__message.is-transient .dermax-ai__bubble::after { animation: none !important; }
}

/* STEP 10B: smart modes + human handoff + lead capture */
.dermax-ai__modebar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 18px;
  border-bottom: 1px solid rgba(220,171,80,.10);
  background: linear-gradient(90deg, rgba(212,166,78,.07), rgba(255,255,255,.012));
  color: rgba(255,255,255,.64);
  font: 600 10px/1.2 Inter, ui-sans-serif, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dermax-ai__modebar.is-general { background: rgba(255,255,255,.01); }
.dermax-ai__mode-label { color: var(--dermax-ai-gold-bright); }
.dermax-ai__modebar button {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.38);
  cursor: pointer;
  padding: 3px 0;
  font: 600 9px/1 Inter, ui-sans-serif, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.dermax-ai__modebar button:hover { color: var(--dermax-ai-gold-bright); }

.dermax-ai__bubble a {
  color: #f4ca76;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.dermax-ai__message--user .dermax-ai__bubble a { color: #16110a; }

.dermax-ai__handoff {
  position: relative;
  z-index: 3;
  margin: 0 14px 9px;
  border: 1px solid rgba(221,173,83,.20);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,.015);
}
.dermax-ai__handoff-toggle {
  width: 100%;
  min-height: 39px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.70);
  cursor: pointer;
  font: 600 11px/1.2 Inter, ui-sans-serif, sans-serif;
  text-align: left;
}
.dermax-ai__handoff-toggle > span:first-child {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--dermax-ai-gold-bright);
  background: rgba(212,166,78,.08);
}
.dermax-ai__handoff-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dermax-ai__handoff-toggle > span:nth-child(2) { flex: 1; }
.dermax-ai__handoff-toggle b { color: var(--dermax-ai-gold-bright); font-size: 17px; font-weight: 400; }
.dermax-ai__handoff-toggle:hover,
.dermax-ai__handoff-toggle.is-open { background: rgba(212,166,78,.05); color: #fff3db; }
.dermax-ai__handoff-panel {
  padding: 4px 10px 11px;
  border-top: 1px solid rgba(221,173,83,.12);
}
.dermax-ai__handoff-panel[hidden] { display: none !important; }
.dermax-ai__handoff-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 9px 0 7px;
}
.dermax-ai__handoff-link {
  min-width: 0;
  min-height: 42px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(218,169,77,.28);
  border-radius: 12px;
  background: rgba(255,255,255,.018);
  color: rgba(255,255,255,.78);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.dermax-ai__handoff-link:hover { transform: translateY(-1px); border-color: rgba(240,195,104,.68); background: rgba(214,164,72,.07); }
.dermax-ai__handoff-link span { color: var(--dermax-ai-gold-bright); font: 700 11px/1 Inter, ui-sans-serif, sans-serif; }
.dermax-ai__handoff-link b { color: inherit; font: 600 9.5px/1.15 Inter, ui-sans-serif, sans-serif; text-align: center; }

.dermax-ai__lead-open {
  width: 100%;
  margin-top: 2px;
  min-height: 35px;
  border: 1px solid rgba(218,169,77,.24);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(212,166,78,.08), rgba(255,255,255,.015));
  color: #f1d293;
  cursor: pointer;
  font: 600 10.5px/1 Inter, ui-sans-serif, sans-serif;
}
.dermax-ai__lead-form { padding-top: 9px; }
.dermax-ai__lead-form[hidden] { display: none !important; }
.dermax-ai__lead-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.dermax-ai__lead-form input,
.dermax-ai__lead-form select,
.dermax-ai__lead-form textarea {
  width: 100%;
  border: 1px solid rgba(223,176,87,.23);
  border-radius: 10px;
  background: rgba(9,9,8,.58);
  color: rgba(255,255,255,.84);
  outline: none;
  box-shadow: none;
  font: 400 10.5px/1.35 Inter, ui-sans-serif, sans-serif;
}
.dermax-ai__lead-form input,
.dermax-ai__lead-form select { height: 36px; padding: 0 9px; }
.dermax-ai__lead-form textarea { min-height: 66px; margin-top: 7px; padding: 9px; resize: vertical; }
.dermax-ai__lead-form input:focus,
.dermax-ai__lead-form select:focus,
.dermax-ai__lead-form textarea:focus { border-color: rgba(239,194,103,.68); }
.dermax-ai__lead-form select { color-scheme: dark; }
.dermax-ai__lead-consent {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 7px 1px;
  color: rgba(255,255,255,.47);
  font: 400 9px/1.35 Inter, ui-sans-serif, sans-serif;
}
.dermax-ai__lead-consent input { width: 13px; height: 13px; flex: 0 0 auto; margin: 1px 0 0; }
.dermax-ai__lead-submit {
  width: 100%;
  min-height: 37px;
  border: 1px solid rgba(255,223,156,.26);
  border-radius: 11px;
  background: linear-gradient(145deg, #dfad52, #95631e);
  color: #100d08;
  cursor: pointer;
  font: 700 10.5px/1 Inter, ui-sans-serif, sans-serif;
}
.dermax-ai__lead-submit:disabled { opacity: .55; cursor: wait; }
.dermax-ai__lead-result { min-height: 0; margin-top: 7px; font: 500 9.5px/1.35 Inter, ui-sans-serif, sans-serif; }
.dermax-ai__lead-result.is-success { color: #7ce4a6; }
.dermax-ai__lead-result.is-error { color: #ff9f9f; }

@media (max-width: 600px) {
  .dermax-ai__modebar { padding: 7px 13px; }
  .dermax-ai__handoff { margin: 0 10px 8px; }
}

@media (max-width: 390px) {
  .dermax-ai__handoff-links { grid-template-columns: 1fr; }
  .dermax-ai__lead-grid { grid-template-columns: 1fr; }
}

/* STEP 10C — grounded knowledge source chips */
.dermax-ai__message-content {
  min-width: 0;
  max-width: 82%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}
.dermax-ai__message-content .dermax-ai__bubble { max-width: 100%; }
.dermax-ai__message--user .dermax-ai__message-content { align-items: flex-end; }
.dermax-ai__sources {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 0 2px;
}
.dermax-ai__sources-label {
  color: rgba(255,255,255,.34);
  font: 600 8px/1 Inter, ui-sans-serif, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dermax-ai__source-chip {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  max-width: 190px;
  padding: 5px 8px;
  border: 1px solid rgba(226,178,87,.24);
  border-radius: 999px;
  background: rgba(208,158,70,.055);
  color: #e9c57d;
  text-decoration: none;
  font: 600 8.5px/1.15 Inter, ui-sans-serif, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.dermax-ai__source-chip:hover {
  border-color: rgba(242,197,107,.55);
  background: rgba(214,164,72,.11);
  color: #ffe0a0;
}
.dermax-ai__source-chip--static { cursor: default; }

@media (max-width: 600px) {
  .dermax-ai__message-content { max-width: 84%; }
  .dermax-ai__source-chip { max-width: 150px; }
}
