/* Noé — floating commercial assistant on arkaiu.com */
.noe-root {
  --noe-z: 240;
  --noe-brand: #06b6d4;
  --noe-brand-dark: #0e7490;
  --noe-ink: #0f172a;
  --noe-muted: #64748b;
  --noe-line: #e2e8f0;
  --noe-surface: #ffffff;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: var(--noe-z);
  font-family: inherit;
  pointer-events: none;
}

.noe-root > * {
  pointer-events: auto;
}

.noe-launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--noe-brand) 45%, white);
  border-radius: 9999px;
  background: var(--noe-surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.noe-launcher:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 32px rgba(6, 182, 212, 0.28);
}

.noe-launcher:focus-visible {
  outline: 2px solid var(--noe-brand-dark);
  outline-offset: 3px;
}

.noe-launcher-photo {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 9999px;
  object-fit: cover;
}

.noe-root.is-open .noe-launcher {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

.noe-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: none;
  flex-direction: column;
  width: min(20rem, calc(100vw - 1.5rem));
  height: min(28rem, calc(100vh - 7rem));
  border: 1px solid var(--noe-line);
  border-radius: 1.1rem;
  background: var(--noe-surface);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.22);
  overflow: hidden;
}

/* display:flex would override HTML [hidden]; only show when opened */
.noe-root.is-open .noe-panel:not([hidden]) {
  display: flex;
}

.noe-panel[hidden],
.noe-profile[hidden],
.noe-chat-body[hidden] {
  display: none !important;
}

.noe-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.75rem;
  border-bottom: 1px solid var(--noe-line);
  background: linear-gradient(180deg, #ecfeff, #fff);
}

.noe-identity {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  padding: 0;
}

.noe-identity-photo {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  object-fit: cover;
}

.noe-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.noe-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--noe-ink);
  line-height: 1.1;
}

.noe-subtitle {
  font-size: 0.72rem;
  color: var(--noe-muted);
}

.noe-header-actions {
  display: flex;
  gap: 0.2rem;
}

.noe-minimize,
.noe-close {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--noe-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.noe-minimize:hover,
.noe-close:hover {
  background: #f1f5f9;
  color: var(--noe-ink);
}

.noe-chat-body {
  display: none;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.noe-chat-body:not([hidden]) {
  display: flex;
}

.noe-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: #f8fafc;
}

.noe-bubble {
  max-width: 92%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.875rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.noe-bubble--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--noe-line);
  color: var(--noe-ink);
}

.noe-bubble--user {
  align-self: flex-end;
  background: var(--noe-brand);
  color: #082f49;
  font-weight: 600;
}

.noe-bubble--thinking {
  opacity: 0.7;
  font-style: italic;
}

.noe-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem 0.15rem;
  background: #fff;
  border-top: 1px solid var(--noe-line);
}

.noe-chip {
  border: 1px solid color-mix(in srgb, var(--noe-brand) 35%, var(--noe-line));
  border-radius: 9999px;
  background: #ecfeff;
  color: var(--noe-brand-dark);
  font-size: 0.72rem;
  font-weight: 650;
  padding: 0.28rem 0.65rem;
  cursor: pointer;
}

.noe-chip:hover {
  background: #cffafe;
}

.noe-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--noe-line);
  background: #fff;
  position: relative;
}

.noe-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.noe-input {
  width: 100%;
  min-height: 2.5rem;
  max-height: 6rem;
  resize: none;
  border: 1px solid var(--noe-line);
  border-radius: 0.75rem;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.875rem;
  color: var(--noe-ink);
}

.noe-input:focus {
  outline: 2px solid color-mix(in srgb, var(--noe-brand) 55%, transparent);
  border-color: var(--noe-brand);
}

.noe-send {
  border: 0;
  border-radius: 0.75rem;
  background: var(--noe-brand-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0 0.9rem;
  cursor: pointer;
}

.noe-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.noe-footnote {
  margin: 0;
  padding: 0 0.85rem 0.55rem;
  font-size: 0.65rem;
  line-height: 1.3;
  color: var(--noe-muted);
  background: #fff;
}

.noe-profile {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  padding: 1.25rem 1rem;
  text-align: center;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.noe-profile:not([hidden]) {
  display: flex;
}

.noe-profile-photo {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 9999px;
  object-fit: cover;
  border: 3px solid #cffafe;
}

.noe-profile-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--noe-ink);
}

.noe-profile-role {
  margin: 0;
  color: var(--noe-brand-dark);
  font-weight: 650;
  font-size: 0.85rem;
}

.noe-profile-bio {
  margin: 0;
  color: var(--noe-muted);
  font-size: 0.85rem;
  line-height: 1.45;
}

.noe-profile-back {
  margin-top: 0.5rem;
  border: 1px solid var(--noe-line);
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.55rem 0.9rem;
  font-weight: 650;
  cursor: pointer;
}

@media (max-width: 420px) {
  .noe-panel {
    width: calc(100vw - 1rem);
    height: min(70vh, 30rem);
  }
}
