/* Calli — wenglor CamTec chatbot. Visual design ported from the wenglor
   design-system project (Claude Design "#161268 - integrated calli chatbot").
   No external font/CDN requests are made (GDPR: avoid leaking visitor IPs to
   third parties) — the system font stack stands in for the corporate
   NimbusSansGlobal typeface. */

:root {
  --cali-blue: rgb(0, 97, 158);
  --cali-blue-dark: rgb(0, 77, 127);
  --cali-blue-600: rgb(20, 125, 189);
  --cali-blue-50: rgb(230, 243, 250);
  --cali-blue-100: rgb(194, 225, 242);
  --slate: rgb(125, 155, 196);
  --divider: rgba(0, 0, 0, 0.12);
  --txt: rgba(0, 0, 0, 0.87);
  --txt2: rgba(0, 0, 0, 0.6);
  --txt3: rgba(0, 0, 0, 0.45);
  --surface: #fff;
  --body-bg: rgb(247, 248, 250);
  --hover: rgba(0, 0, 0, 0.04);
  --success: rgb(2, 143, 120);
  --error: rgb(198, 40, 40);
  --error-bg: rgb(253, 236, 234);
  --warning: rgb(102, 60, 0);
  --warning-bg: rgb(255, 244, 229);
  --ff: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--ff);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  background: var(--body-bg);
}

a {
  color: var(--cali-blue);
}
a:hover {
  color: var(--cali-blue-dark);
}

/* ===== shell: rail + chat ===== */
.c-shell {
  height: 100%;
  display: grid;
  grid-template-columns: 330px 1fr;
  background: #fff;
}

.c-rail {
  display: flex;
  flex-direction: column;
  background: var(--body-bg);
  border-right: 1px solid var(--divider);
  min-height: 0;
  overflow-y: auto;
}

.c-rail__hero {
  position: relative;
  background: linear-gradient(160deg, var(--cali-blue) 0%, var(--cali-blue-dark) 100%);
  height: 220px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  flex: none;
}
.c-rail__hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.14), transparent 60%);
}

.c-rail__mascot {
  position: relative;
  z-index: 1;
  height: 100%;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 30, 55, 0.35));
}

.c-rail__body {
  padding: 18px 18px 20px;
  flex: 1;
  min-height: 0;
}

.c-rail__name {
  font-size: 23px;
  font-weight: 700;
  color: var(--txt);
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1;
}

.c-beta {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: var(--cali-blue-50);
  color: var(--cali-blue-dark);
  padding: 3px 7px;
  border-radius: 4px;
}

.c-rail__role {
  font-size: 13px;
  color: var(--txt2);
  margin: 6px 0 0;
}

.c-rail__group {
  margin-top: 20px;
}

.c-rail__label {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 10px;
}

.c-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.c-rail__hint {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--txt2);
}

.c-chip {
  background: var(--cali-blue-50);
  color: var(--cali-blue-dark);
  border: 1px solid var(--cali-blue-100);
  border-radius: 100px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
}

.c-rail__topics {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.c-topic {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  text-align: left;
  font-family: var(--ff);
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 11px 12px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--txt);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.c-topic:hover {
  border-color: var(--cali-blue);
  background: var(--cali-blue-50);
  box-shadow: 0 2px 8px rgba(0, 60, 100, 0.1);
}
.c-topic svg {
  flex: none;
  color: var(--cali-blue);
}

/* ===== language toggle ===== */
.c-lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 100px;
  padding: 3px;
}

.c-lang-toggle__btn {
  font-family: var(--ff);
  font-size: 12px;
  font-weight: 600;
  color: var(--txt2);
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.c-lang-toggle__btn:hover {
  color: var(--cali-blue-dark);
}

.c-lang-toggle__btn.is-active {
  background: var(--cali-blue);
  color: #fff;
}

/* ===== chat panel ===== */
.c-chat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.c-chat__head {
  flex: none;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  border-bottom: 1px solid var(--divider);
}

.c-chat__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 700;
  color: var(--txt);
}

.c-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--cali-blue) 0%, var(--cali-blue-dark) 100%);
  border: 2px solid var(--cali-blue-100);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  flex: none;
}

.c-header-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.c-header-name {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.1;
}

.c-chat__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.c-session-feedback {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--txt2);
}

.c-session-feedback__q {
  margin-right: 2px;
}

.c-session-feedback__btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--divider);
  background: #fff;
  color: var(--txt3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.c-session-feedback__btn:hover {
  background: var(--cali-blue-50);
  color: var(--cali-blue);
  border-color: var(--cali-blue-100);
}

.c-session-feedback--done {
  color: var(--success);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

.c-chat__reset {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff);
  font-size: 13px;
  color: var(--txt2);
  background: none;
  border: 1px solid var(--divider);
  border-radius: 100px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.c-chat__reset:hover {
  background: var(--cali-blue-50);
  color: var(--cali-blue-dark);
  border-color: var(--cali-blue-100);
}

.c-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--body-bg);
}
.c-body::-webkit-scrollbar {
  width: 8px;
}
.c-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 8px;
}

/* ===== message list ===== */
.message-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-row {
  display: flex;
  gap: 9px;
  align-items: flex-end;
}
.message-row--user {
  justify-content: flex-end;
}

.message-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 82%;
  min-width: 0;
}

.avatar {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--cali-blue) 0%, var(--cali-blue-dark) 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
}

.message {
  max-width: 100%;
  padding: 11px 14px;
  font-size: 14.5px;
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: break-word;
  white-space: pre-wrap;
}

.message--assistant {
  background: #fff;
  border: 1px solid var(--divider);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  color: var(--txt);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.message--user {
  background: var(--cali-blue);
  color: #fff;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 60, 100, 0.25);
}

.message--assistant p {
  margin: 0 0 8px;
}
.message--assistant p:last-child {
  margin-bottom: 0;
}
.message--assistant ul {
  margin: 6px 0;
  padding-left: 20px;
}
.message--assistant strong {
  font-weight: 700;
}

/* ===== product chips in intro bubble ===== */
.c-prodwrap {
  padding-top: 10px;
  border-top: 1px solid var(--divider);
  margin-top: 2px;
}

.c-prodlabel {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--txt3);
  margin-bottom: 7px;
}

.status-line {
  display: flex;
  gap: 7px;
  align-items: center;
  font-style: normal;
  color: var(--txt2);
  font-size: 13px;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--txt2);
  animation: typing-dot 1.3s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.18s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.36s;
}

@keyframes typing-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }

  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .typing-indicator span {
    animation: none;
  }
}

/* ===== persistent beta/attribution banner ===== */
.c-info-banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  background: var(--cali-blue-50);
  border: 1px solid var(--cali-blue-100);
  color: var(--cali-blue-dark);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.c-info-banner svg {
  flex: none;
  margin-top: 1px;
  color: var(--cali-blue);
}
.c-info-banner p {
  margin: 0;
}
.c-info-banner a {
  color: var(--cali-blue-dark);
  font-weight: 600;
  text-decoration: underline;
}
.c-info-banner a:hover {
  color: var(--cali-blue);
}

/* ===== banner / citations ===== */
.banner {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
}
.banner[data-kind="error"] {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(198, 40, 40, 0.25);
}
.banner[data-kind="warning"] {
  background: var(--warning-bg);
  color: var(--warning);
  border: 1px solid rgba(102, 60, 0, 0.2);
}

.citation-list {
  background: var(--cali-blue-50);
  border: 1px solid var(--cali-blue-100);
  color: var(--cali-blue-dark);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
}
.citation-list strong {
  display: block;
  margin-bottom: 6px;
}
.citation-list ul {
  margin: 0;
  padding-left: 18px;
}
.citation-list a {
  color: var(--cali-blue-dark);
  text-decoration: underline;
}

/* ===== footer / input ===== */
.c-footer {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--divider);
  padding: 14px 20px 12px;
}

.chat-form {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  border: 1px solid var(--divider);
  border-radius: 24px;
  padding: 5px 5px 5px 16px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-form:focus-within {
  border-color: var(--cali-blue);
  box-shadow: 0 0 0 3px rgba(0, 97, 158, 0.15);
}

.chat-form textarea {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  resize: none;
  overflow-y: auto;
  font-family: var(--ff);
  font-size: 14.5px;
  line-height: 1.4;
  max-height: 120px;
  padding: 8px 0;
  background: transparent;
  color: var(--txt);
}
.chat-form textarea::placeholder {
  color: var(--txt3);
}

.c-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--cali-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background 0.15s, transform 0.1s;
}
.c-send:hover:not(:disabled) {
  background: var(--cali-blue-dark);
}
.c-send:active:not(:disabled) {
  transform: scale(0.94);
}
.c-send:disabled {
  background: rgba(0, 0, 0, 0.14);
  cursor: default;
}

.c-disclaimer {
  font-size: 11px;
  color: var(--txt3);
  text-align: center;
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.c-disclaimer__links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.c-disclaimer__sep {
  color: var(--txt3);
}
.c-disclaimer a {
  color: var(--cali-blue);
  text-decoration: underline;
}

@media (max-width: 900px) {
  .c-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: 100%;
  }
  .c-rail {
    border-right: none;
    border-bottom: 1px solid var(--divider);
    overflow-y: visible;
  }
  .c-chat {
    min-height: 70vh;
  }
  .c-session-feedback__q {
    display: none;
  }
}
