
:root {
  --evoluna-navy: #152b4f;
  --evoluna-navy-2: #213f70;
  --evoluna-blue: #6f9ee7;
  --evoluna-silver: #e9eef7;
  --evoluna-white: #ffffff;
  --evoluna-text: #172238;
  --evoluna-shadow: 0 22px 60px rgba(13, 29, 55, .26);
  --evoluna-character-width: clamp(180px, 16vw, 260px);
}

.evoluna-concierge {
  position: fixed;
  inset: auto 0 0 auto;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", Meiryo, sans-serif;
  color: var(--evoluna-text);
}

.evoluna-standee-button {
  position: fixed;
  right: 10px;
  bottom: 0;
  width: var(--evoluna-character-width);
  height: auto;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  filter: drop-shadow(0 18px 22px rgba(11, 26, 52, .22));
  transform-origin: 50% 100%;
  transition: transform .22s ease, filter .22s ease, opacity .22s ease;
}

.evoluna-standee-button:hover {
  transform: translateY(-4px) scale(1.015);
  filter: drop-shadow(0 24px 28px rgba(11, 26, 52, .28));
}

.evoluna-standee {
  display: block;
  width: 100%;
  height: auto;
  max-height: 74vh;
  object-fit: contain;
  object-position: bottom right;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.evoluna-launcher {
  position: fixed;
  right: calc(var(--evoluna-character-width) - 18px);
  bottom: 24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 999px;
  padding: 7px 15px 7px 7px;
  background: linear-gradient(135deg, rgba(20, 42, 77, .98), rgba(35, 67, 118, .98));
  color: #fff;
  box-shadow: var(--evoluna-shadow);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.evoluna-launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 65px rgba(13, 29, 55, .34);
}

.evoluna-launcher-avatar {
  width: 52px;
  height: 52px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.88);
  background: #eaf0fa;
}

.evoluna-launcher-copy {
  display: grid;
  text-align: left;
  line-height: 1.22;
}

.evoluna-launcher-copy strong {
  font-size: .92rem;
}

.evoluna-launcher-copy small {
  margin-top: 3px;
  font-size: .66rem;
  opacity: .72;
  font-weight: 500;
}

.evoluna-panel {
  position: fixed;
  right: calc(var(--evoluna-character-width) - 6px);
  bottom: 22px;
  width: min(390px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 44px));
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: rgba(255,255,255,.985);
  box-shadow: var(--evoluna-shadow);
  color: var(--evoluna-text);
  z-index: 5;
  animation: evoluna-panel-in .2s ease-out;
}

@keyframes evoluna-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.evoluna-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 13px;
  background:
    radial-gradient(circle at 15% 10%, rgba(124,161,226,.34), transparent 42%),
    linear-gradient(135deg, #132542, #244778);
  color: #fff;
}

.evoluna-header-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.evoluna-header-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid rgba(255,255,255,.85);
  background: #edf2fb;
}

.evoluna-title {
  font-weight: 800;
  letter-spacing: .03em;
}

.evoluna-subtitle {
  margin-top: 2px;
  font-size: .72rem;
  opacity: .78;
}

.evoluna-close {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.85rem;
  line-height: 1;
  cursor: pointer;
}

.evoluna-messages {
  height: calc(100% - 130px);
  overflow-y: auto;
  padding: 15px;
  background:
    radial-gradient(circle at 100% 0%, rgba(108,144,211,.10), transparent 35%),
    linear-gradient(180deg, #f8faff, #f5f7fb);
}

.evoluna-message {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 12px;
}

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

.evoluna-message-avatar,
.evoluna-info-avatar {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.evoluna-message-avatar {
  object-fit: cover;
  object-position: center 20%;
  border: 1px solid #d8e1f1;
  background: #eaf0f8;
}

.evoluna-info-avatar {
  display: grid;
  place-items: center;
  background: #e9eef8;
  color: #60708b;
  font-weight: 700;
}

.evoluna-bubble {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(25, 42, 75, .07);
  line-height: 1.55;
  font-size: .92rem;
}

.evoluna-message-user .evoluna-bubble {
  background: #20395f;
  color: #fff;
}

.evoluna-quick-actions {
  display: grid;
  gap: 7px;
  margin: 6px 0 14px 45px;
}

.evoluna-quick-actions button {
  width: 100%;
  border: 1px solid #d6deee;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  color: #243754;
  text-align: left;
  cursor: pointer;
}

.evoluna-quick-actions button:hover {
  border-color: #9eb4da;
  background: #f2f6fd;
}

.evoluna-placeholder-note {
  opacity: .72;
}

.evoluna-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid #e1e6ef;
  background: #fff;
}

.evoluna-form textarea {
  min-height: 42px;
  max-height: 100px;
  resize: none;
  border: 1px solid #d5ddea;
  border-radius: 12px;
  padding: 10px 11px;
  font: inherit;
}

.evoluna-form button {
  border: 0;
  border-radius: 12px;
  padding: 0 15px;
  background: #1b3155;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

@media (max-width: 1100px) {
  :root {
    --evoluna-character-width: clamp(160px, 17vw, 205px);
  }

  .evoluna-panel {
    right: calc(var(--evoluna-character-width) - 12px);
  }

  .evoluna-launcher {
    right: calc(var(--evoluna-character-width) - 26px);
  }
}

@media (max-width: 780px) {
  .evoluna-standee-button {
    display: none;
  }

  .evoluna-launcher {
    right: 12px;
    bottom: 12px;
    width: 62px;
    height: 62px;
    padding: 5px;
    border-radius: 50%;
  }

  .evoluna-launcher-avatar {
    width: 50px;
    height: 50px;
  }

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

  .evoluna-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: min(76vh, 650px);
  }
}


/* ===== v0.3 AI connection states ===== */
.evoluna-form textarea:disabled,
.evoluna-form button:disabled,
.evoluna-quick-actions button:disabled {
  cursor: wait;
  opacity: .62;
}

.evoluna-typing .evoluna-bubble {
  color: #6b7890;
  font-style: italic;
}

.evoluna-error .evoluna-bubble {
  border: 1px solid #ead7d7;
  background: #fff8f8;
}

.evoluna-privacy-note .evoluna-bubble {
  font-size: .82rem;
  color: #66748b;
}


/* ===== v0.5 safe Markdown rendering ===== */
.evoluna-markdown .evoluna-md-line + .evoluna-md-line {
  margin-top: .28em;
}

.evoluna-markdown .evoluna-md-gap {
  height: .65em;
}

.evoluna-markdown .evoluna-md-heading {
  margin: .15em 0 .4em;
  font-weight: 800;
  color: #20395f;
}

.evoluna-markdown ul,
.evoluna-markdown ol {
  margin: .45em 0 .45em 1.3em;
  padding: 0;
}

.evoluna-markdown li + li {
  margin-top: .25em;
}

.evoluna-markdown strong {
  font-weight: 800;
}

.evoluna-markdown em {
  font-style: italic;
}

.evoluna-markdown code {
  padding: .08em .3em;
  border-radius: 5px;
  background: #edf2f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: .9em;
}
