:root {
  color-scheme: light;
  --ac-navy: #07142b;
  --ac-navy-2: #10264a;
  --ac-blue: #1769e8;
  --ac-blue-2: #0f5ed9;
  --ac-blue-soft: #edf5ff;
  --ac-ink: #14223a;
  --ac-muted: #63718a;
  --ac-line: #dbe4f0;
  --ac-line-strong: #c6d3e3;
  --ac-canvas: #f4f7fb;
  --ac-shadow-sm: 0 10px 26px rgba(7, 20, 43, .07);
  --ac-shadow-lg: 0 24px 70px rgba(7, 20, 43, .12);
}

* { box-sizing: border-box; }

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

body.agenz-chat-page {
  overflow: hidden;
  color: var(--ac-ink);
  background: var(--ac-canvas);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea,
a { font: inherit; }

button,
a { -webkit-tap-highlight-color: transparent; }

button { color: inherit; }

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 105, 232, .24);
  outline-offset: 2px;
}

.ac-skip,
.ac-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ac-skip:focus {
  z-index: 1000;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 10px 14px;
  margin: 0;
  clip: auto;
  color: #fff;
  background: var(--ac-navy);
  border-radius: 10px;
}

.ac-app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  overflow: hidden;
  background:
    linear-gradient(rgba(28, 76, 145, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(28, 76, 145, .032) 1px, transparent 1px),
    var(--ac-canvas);
  background-size: 72px 72px;
}

.ac-topbar {
  position: relative;
  z-index: 20;
  min-width: 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(330px, 1fr);
  align-items: center;
  gap: 20px;
  border-bottom: 1px solid rgba(13, 39, 78, .12);
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 26px rgba(9, 25, 55, .045);
  backdrop-filter: blur(18px);
}

.ac-brand {
  width: fit-content;
  display: inline-flex;
  align-items: center;
}

.ac-brand img {
  width: 182px;
  max-width: 100%;
  height: auto;
  display: block;
}

.ac-topbar-center {
  min-height: 34px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--ac-line);
  border-radius: 999px;
  color: #40516d;
  background: #f8fafd;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ac-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #18b881;
  box-shadow: 0 0 0 5px rgba(24, 184, 129, .1);
}

.ac-topbar-actions {
  min-width: 0;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ac-language {
  padding: 3px;
  display: flex;
  border: 1px solid var(--ac-line);
  border-radius: 12px;
  background: #f7f9fc;
}

.ac-language button {
  min-width: 34px;
  height: 30px;
  border: 0;
  border-radius: 9px;
  color: #718099;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.ac-language button[aria-pressed="true"] {
  color: #fff;
  background: var(--ac-blue);
  box-shadow: 0 4px 12px rgba(23, 105, 232, .2);
}

.ac-home-link,
.ac-consult-link {
  min-height: 38px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #44536d;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .035em;
  text-transform: uppercase;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}

.ac-home-link:hover { background: #f0f4fa; }

.ac-consult-link {
  color: #fff;
  background: var(--ac-blue);
  box-shadow: 0 8px 20px rgba(23, 105, 232, .2);
}

.ac-consult-link:hover {
  transform: translateY(-1px);
  background: var(--ac-blue-2);
  box-shadow: 0 12px 24px rgba(23, 105, 232, .24);
}

.ac-layout {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: 294px minmax(0, 1fr);
  overflow: hidden;
}

.ac-sidebar {
  min-width: 0;
  min-height: 0;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  border-right: 1px solid rgba(13, 39, 78, .12);
  background: rgba(249, 251, 254, .96);
  scrollbar-width: thin;
  scrollbar-color: #c9d5e5 transparent;
}

.ac-new-chat {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--ac-line-strong);
  border-radius: 13px;
  background: #fff;
  color: var(--ac-ink);
  box-shadow: 0 7px 18px rgba(7, 20, 43, .04);
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.ac-new-chat:hover {
  transform: translateY(-1px);
  border-color: #91acd0;
  box-shadow: var(--ac-shadow-sm);
}

.ac-new-chat span {
  color: var(--ac-blue);
  font-size: 20px;
  font-weight: 400;
}

.ac-new-chat b {
  font-size: 12px;
  font-weight: 800;
}

.ac-sidebar-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 22px 19px 23px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(circle at 88% 6%, rgba(43, 123, 244, .68), transparent 34%),
    linear-gradient(145deg, var(--ac-navy-2), var(--ac-navy));
  box-shadow: 0 16px 34px rgba(7, 20, 43, .16);
}

.ac-sidebar-card:after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -60px;
  z-index: -1;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, .025);
}

.ac-eyebrow {
  display: block;
  color: var(--ac-blue);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .15em;
  text-transform: uppercase;
}

.ac-sidebar-card .ac-eyebrow { color: #7eb4ff; }

.ac-sidebar-card h1 {
  margin: 12px 0 11px;
  color: #fff;
  font-size: 22px;
  line-height: 1.08;
  letter-spacing: -.04em;
}

.ac-sidebar-card p {
  margin: 0;
  color: rgba(231, 239, 251, .76);
  font-size: 12px;
  line-height: 1.62;
}

.ac-topic-list {
  display: grid;
  gap: 6px;
}

.ac-topic-list button {
  width: 100%;
  padding: 12px 11px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.ac-topic-list button:hover,
.ac-topic-list button:focus-visible {
  transform: translateX(2px);
  border-color: var(--ac-line);
  background: #fff;
}

.ac-topic-list button > span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #6d81a2;
  background: #edf3fb;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .06em;
}

.ac-topic-list b,
.ac-topic-list small { display: block; }

.ac-topic-list b {
  color: #25344e;
  font-size: 11.5px;
  line-height: 1.4;
}

.ac-topic-list small {
  margin-top: 2px;
  color: #7e8a9e;
  font-size: 9.5px;
  line-height: 1.45;
}

.ac-sidebar-note {
  margin-top: auto;
  padding: 13px 10px 0;
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--ac-line);
  color: #59708f;
}

.ac-sidebar-note > span {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b845f;
  background: #e8f8f2;
  font-size: 11px;
  font-weight: 900;
}

.ac-sidebar-note p { margin: 0; }
.ac-sidebar-note b,
.ac-sidebar-note small { display: block; }
.ac-sidebar-note b { color: #30415f; font-size: 10.5px; }
.ac-sidebar-note small { margin-top: 3px; font-size: 9.5px; line-height: 1.5; }

.ac-chat {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) auto;
  overflow: hidden;
  background: rgba(255, 255, 255, .72);
}

.ac-chat-head {
  min-width: 0;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--ac-line);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
}

.ac-agent {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.ac-agent-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: var(--ac-navy);
  box-shadow: 0 8px 18px rgba(7, 20, 43, .15);
}

.ac-agent-mark img {
  width: 29px;
  height: 29px;
  object-fit: contain;
}

.ac-agent > div { min-width: 0; }

.ac-agent > div > b {
  display: block;
  color: var(--ac-navy);
  font-size: 13.5px;
}

.ac-agent > div > span {
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #718099;
  font-size: 10px;
}

.ac-agent > div > span i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #18b881;
}

.ac-clear {
  padding: 9px 11px;
  border: 0;
  border-radius: 9px;
  color: #718099;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.ac-clear:hover { color: var(--ac-ink); background: #f1f4f8; }

.ac-thread {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #c7d3e3 transparent;
}

.ac-empty[hidden] { display: none !important; }

.ac-empty {
  width: min(860px, calc(100% - 48px));
  min-height: 100%;
  margin: 0 auto;
  padding: 28px 0 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ac-hero-mark {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background:
    radial-gradient(circle at 32% 24%, rgba(78, 151, 255, .55), transparent 34%),
    var(--ac-navy);
  box-shadow: 0 18px 40px rgba(7, 20, 43, .2);
}

.ac-hero-mark:after {
  content: "";
  position: absolute;
  inset: -7px;
  z-index: -1;
  border: 1px solid rgba(23, 105, 232, .16);
  border-radius: 26px;
}

.ac-hero-mark img {
  width: 47px;
  height: 47px;
  object-fit: contain;
}

.ac-empty h2 {
  max-width: 680px;
  margin: 12px 0 10px;
  color: var(--ac-navy);
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.02;
  letter-spacing: -.055em;
}

.ac-empty > p {
  max-width: 650px;
  margin: 0;
  color: var(--ac-muted);
  font-size: 13px;
  line-height: 1.65;
}

.ac-starters {
  width: 100%;
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  text-align: left;
}

.ac-starters button {
  position: relative;
  min-height: 100px;
  padding: 17px 38px 15px 17px;
  border: 1px solid var(--ac-line);
  border-radius: 15px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 9px 24px rgba(7, 20, 43, .045);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.ac-starters button:hover {
  transform: translateY(-3px);
  border-color: #a8bfdc;
  box-shadow: 0 16px 34px rgba(7, 20, 43, .085);
}

.ac-starters b,
.ac-starters span { display: block; }

.ac-starters b {
  color: #20314e;
  font-size: 12px;
  line-height: 1.35;
}

.ac-starters span {
  margin-top: 7px;
  color: #7a879b;
  font-size: 10px;
  line-height: 1.48;
}

.ac-starters i {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--ac-blue);
  background: var(--ac-blue-soft);
  font-size: 13px;
  font-style: normal;
}

.ac-messages:empty { display: none; }

.ac-messages {
  width: min(860px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 58px;
}

.ac-message {
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.ac-message.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.ac-message-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 11px;
  color: #fff;
  background: var(--ac-navy);
  box-shadow: 0 8px 18px rgba(7, 20, 43, .12);
}

.ac-message-avatar img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}

.ac-message-bubble {
  max-width: min(720px, 92%);
  padding: 14px 16px;
  border: 1px solid var(--ac-line);
  border-radius: 5px 17px 17px 17px;
  color: #263650;
  background: #fff;
  box-shadow: 0 8px 22px rgba(7, 20, 43, .04);
  font-size: 13px;
  line-height: 1.68;
}

.ac-message.user .ac-message-bubble {
  width: fit-content;
  max-width: min(620px, 84%);
  border-color: var(--ac-blue);
  border-radius: 17px 17px 5px 17px;
  color: #fff;
  background: linear-gradient(135deg, var(--ac-blue), #0b58c9);
  box-shadow: 0 10px 24px rgba(23, 105, 232, .17);
}

.ac-message.error .ac-message-bubble {
  border-color: #efc3cb;
  color: #841b30;
  background: #fff7f8;
  box-shadow: 0 10px 26px rgba(171, 30, 58, .05);
}

.ac-message-bubble p,
.ac-message-bubble h4,
.ac-message-bubble ul,
.ac-message-bubble ol { margin: 0 0 9px; }

.ac-message-bubble > :last-child { margin-bottom: 0; }
.ac-message-bubble h4 { color: var(--ac-navy); font-size: 13.5px; }
.ac-message-bubble ul,
.ac-message-bubble ol { padding-left: 20px; }
.ac-message-bubble a { color: var(--ac-blue); font-weight: 700; overflow-wrap: anywhere; }
.ac-message.user .ac-message-bubble a { color: #fff; }

.ac-message.pending .ac-message-bubble {
  min-width: 64px;
  color: #667894;
  letter-spacing: .14em;
  animation: acPulse 1s ease-in-out infinite;
}

.ac-retry {
  margin-top: 11px;
  padding: 7px 11px;
  border: 1px solid currentColor;
  border-radius: 9px;
  color: inherit;
  background: rgba(255, 255, 255, .7);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.ac-composer-wrap {
  position: relative;
  z-index: 4;
  padding: 14px 24px 16px;
  border-top: 1px solid rgba(220, 229, 241, .86);
  background: linear-gradient(to bottom, rgba(249, 251, 254, .82), #fff 34%);
}

.ac-composer {
  width: min(860px, 100%);
  min-height: 58px;
  margin: 0 auto;
  padding: 7px 7px 7px 17px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  border: 1px solid var(--ac-line-strong);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ac-shadow-lg);
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ac-composer:focus-within {
  border-color: #7ca8e9;
  box-shadow: 0 0 0 4px rgba(23, 105, 232, .08), var(--ac-shadow-lg);
}

.ac-composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 42px;
  max-height: 132px;
  padding: 10px 0 8px;
  resize: none;
  border: 0;
  outline: 0;
  color: var(--ac-ink);
  background: transparent;
  font-size: 13px;
  line-height: 1.55;
}

.ac-composer textarea::placeholder { color: #929fb2; }

.ac-composer button {
  flex: 0 0 auto;
  min-width: 92px;
  height: 44px;
  padding: 0 13px 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--ac-navy);
  box-shadow: 0 9px 20px rgba(7, 20, 43, .2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
}

.ac-composer button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--ac-blue);
}

.ac-composer button i {
  font-size: 16px;
  font-style: normal;
  line-height: 1;
}

.ac-composer button:disabled,
.ac-composer textarea:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.ac-composer-meta {
  width: min(860px, 100%);
  min-height: 15px;
  margin: 7px auto 0;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: #8a96a8;
  font-size: 9px;
  line-height: 1.45;
}

.ac-composer-meta [data-chat-feedback] { color: #526a8b; font-weight: 700; }

@keyframes acPulse {
  50% { opacity: .48; }
}

@media (max-width: 1080px) {
  .ac-topbar { grid-template-columns: 1fr auto; }
  .ac-topbar-center { display: none; }
  .ac-layout { grid-template-columns: 270px minmax(0, 1fr); }
  .ac-home-link { display: none; }
  .ac-empty { width: min(760px, calc(100% - 36px)); }
  .ac-empty h2 { font-size: clamp(32px, 4.2vw, 44px); }
}

@media (max-width: 820px) {
  .ac-app-shell { grid-template-rows: 64px minmax(0, 1fr); }
  .ac-topbar { padding: 0 14px; gap: 10px; }
  .ac-brand img { width: 154px; }
  .ac-consult-link { min-height: 36px; padding-inline: 12px; font-size: 9px; }
  .ac-layout { grid-template-columns: 228px minmax(0, 1fr); }
  .ac-sidebar { padding-inline: 13px; }
  .ac-sidebar-card { padding: 18px 15px; }
  .ac-sidebar-card h1 { font-size: 19px; }
  .ac-sidebar-card p { font-size: 11px; }
  .ac-topic-list small { display: none; }
  .ac-starters { grid-template-columns: 1fr; max-width: 520px; gap: 8px; }
  .ac-starters button { min-height: 76px; padding-block: 13px; }
}

@media (max-width: 720px) {
  .ac-app-shell { grid-template-rows: 62px minmax(0, 1fr); }
  .ac-topbar { grid-template-columns: minmax(0, 1fr) auto; padding: 0 12px; }
  .ac-brand img { width: 145px; }
  .ac-consult-link,
  .ac-home-link { display: none; }
  .ac-language button { min-width: 30px; height: 28px; }
  .ac-layout { display: block; }
  .ac-sidebar { display: none; }
  .ac-chat { height: 100%; grid-template-rows: 58px minmax(0, 1fr) auto; }
  .ac-chat-head { padding: 0 14px; }
  .ac-clear { font-size: 0; }
  .ac-clear:after { content: "↻"; font-size: 18px; }
  .ac-empty { width: min(100% - 24px, 620px); padding: 24px 0 22px; justify-content: flex-start; }
  .ac-hero-mark { width: 56px; height: 56px; margin: 7px 0 16px; border-radius: 18px; }
  .ac-hero-mark img { width: 41px; height: 41px; }
  .ac-empty h2 { font-size: clamp(31px, 10.5vw, 44px); }
  .ac-empty > p { font-size: 12px; }
  .ac-starters { margin-top: 20px; }
  .ac-messages { width: calc(100% - 24px); padding: 20px 0 30px; }
  .ac-message { grid-template-columns: 30px minmax(0, 1fr); gap: 8px; margin-bottom: 19px; }
  .ac-message-avatar { width: 30px; height: 30px; }
  .ac-message-avatar img { width: 23px; height: 23px; }
  .ac-message-bubble { max-width: 96%; padding: 12px 13px; font-size: 12.5px; }
  .ac-message.user .ac-message-bubble { max-width: 88%; }
  .ac-composer-wrap { padding: 10px 10px max(11px, env(safe-area-inset-bottom)); }
  .ac-composer { min-height: 54px; padding-left: 14px; border-radius: 16px; }
  .ac-composer button { min-width: 44px; width: 44px; padding: 0; }
  .ac-composer button span { display: none; }
  .ac-composer-meta { padding-inline: 3px; }
  .ac-composer-meta > span:last-child { display: none; }
}

@media (max-width: 390px) {
  .ac-brand img { width: 132px; }
  .ac-empty h2 { font-size: 30px; }
  .ac-starters button { min-height: 72px; }
}

@media (max-height: 700px) and (min-width: 721px) {
  .ac-sidebar { padding-block: 14px; gap: 12px; }
  .ac-sidebar-card { padding-block: 16px; }
  .ac-sidebar-card h1 { margin-block: 9px; font-size: 19px; }
  .ac-sidebar-card p { display: none; }
  .ac-topic-list button { padding-block: 9px; }
  .ac-empty { padding-block: 18px; }
  .ac-hero-mark { width: 50px; height: 50px; margin-bottom: 13px; border-radius: 16px; }
  .ac-hero-mark img { width: 37px; height: 37px; }
  .ac-empty h2 { margin-block: 9px 7px; font-size: 34px; }
  .ac-starters { margin-top: 17px; }
  .ac-starters button { min-height: 76px; padding-block: 12px; }
  .ac-composer-wrap { padding-block: 10px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .ac-thread { scroll-behavior: auto; }
  .ac-starters button,
  .ac-new-chat,
  .ac-topic-list button,
  .ac-consult-link,
  .ac-composer button { transition: none; }
  .ac-message.pending .ac-message-bubble { animation: none; }
}
