﻿.ai-page {
  margin: 0;
  background: #f6f9fc;
  color: #182b3e;
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ai-workspace *, .ai-workspace *::before, .ai-workspace *::after, .ai-float *, .ai-float *::before, .ai-float *::after {
  box-sizing: border-box;
}
.ai-workspace button, .ai-workspace textarea, .ai-float button, .ai-float textarea {
  font: inherit;
}
.ai-workspace button, .ai-workspace a, .ai-float button, .ai-float a {
  -webkit-tap-highlight-color: transparent;
}
.ai-workspace button, .ai-float button {
  cursor: pointer;
}
.ai-workspace button:disabled, .ai-float button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.ai-workspace [hidden], .ai-float [hidden] {
  display: none !important;
}
.ai-workspace a, .ai-float a {
  color: #007ab6;
}
.ai-workspace :focus-visible, .ai-float :focus-visible {
  outline: 3px solid #3395c8;
  outline-offset: 3px;
}

.ai-workspace {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  max-width: 1800px;
  margin: auto;
}

.ai-sidebar {
  display: flex;
  flex-direction: column;
  padding: 30px 20px 20px;
  background: #edf3f8;
  border-right: 1px solid #dce6ee;
  min-height: 0;
}

.ai-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  margin: 0 8px 30px;
}

.ai-brand__word {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1;
  color: #007ab6;
}
.ai-brand__word span {
  color: #f09b3c;
}

.ai-brand__badge {
  font-size: 9px;
  letter-spacing: 1px;
  font-weight: 700;
  border-left: 1px solid #bfcedb;
  padding-left: 12px;
  color: #596b7c;
}

.ai-new {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid #c5d8e6;
  border-radius: 12px;
  background: #fff;
  color: #007ab6;
  font-weight: 600 !important;
  padding: 11px 14px;
  text-align: left;
  transition: background 0.2s;
}
.ai-new span {
  font-size: 24px;
  line-height: 1;
}
.ai-new:hover {
  background: #e1f1fb;
}

.ai-sidebar__label {
  margin: 30px 10px 12px;
  font-size: 10px;
  letter-spacing: 1.7px;
  color: #596b7c;
  font-weight: 700;
}

.ai-history {
  flex: 1;
  overflow: auto;
  min-height: 0;
}
.ai-history a {
  display: block;
  border-radius: 10px;
  padding: 12px;
  color: #354e63;
  text-decoration: none;
  margin-bottom: 4px;
  transition: background 0.2s;
}
.ai-history a:hover, .ai-history a[aria-current=page] {
  background: #fff;
  color: #007ab6;
}
.ai-history a strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
}
.ai-history a small {
  display: block;
  font-size: 11px;
  color: #596b7c;
  margin-top: 3px;
}

.ai-history:empty {
  flex: 0;
}

.ai-history-empty {
  flex: 1;
  font-size: 12px;
  color: #596b7c;
  margin: 0 10px;
}

.ai-sidebar__footer {
  border-top: 1px solid #dce6ee;
  padding: 20px 8px 0;
  margin-top: 20px;
}
.ai-sidebar__footer a {
  color: #39576c;
  text-decoration: none;
  font-size: 13px;
}
.ai-sidebar__footer span {
  display: block;
  font-size: 11px;
  color: #596b7c;
  margin-top: 8px;
}

.ai-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.ai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 19px 32px;
  border-bottom: 1px solid #dce6ee;
}

.ai-header__identity {
  display: flex;
  gap: 12px;
  align-items: center;
  min-width: 0;
}
.ai-header__identity h1 {
  font-size: 16px;
  line-height: 1.4;
  margin: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.ai-header__identity p {
  margin: 3px 0 0;
  font-size: 11px;
  color: #596b7c;
}

.ai-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  background: #e8f5fc;
  color: #007ab6;
  border-radius: 13px;
}
.ai-avatar svg {
  width: 24px;
  height: 24px;
}

.ai-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #268865;
  border-radius: 50%;
  margin-right: 4px;
}

.ai-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid #dce6ee;
  border-radius: 12px;
  color: #596b7c;
  background: #fff;
  flex-shrink: 0;
}
.ai-icon-button:hover {
  background: #eef6fc;
  color: #007ab6;
}
.ai-icon-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-mobile-menu {
  display: none;
}

.ai-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 24px 40px;
  scrollbar-gutter: stable;
}

.ai-welcome {
  max-width: 760px;
  margin: 32px auto 24px;
}

.ai-welcome__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border: 1px solid #d3e9f6;
  background: #eff8fe;
  border-radius: 22px;
  color: #007ab6;
}
.ai-welcome__mark svg {
  width: 35px;
  height: 35px;
}

.ai-eyebrow {
  display: block;
  font-size: 10px;
  letter-spacing: 2.2px;
  font-weight: 700;
  color: #007ab6;
  margin: 25px 0 12px;
}

.ai-welcome h2 {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.18;
  letter-spacing: -1.4px;
  font-weight: 650;
  margin: 0 0 18px;
}

.ai-welcome > p {
  max-width: 490px;
  color: #596b7c;
  margin: 0;
  line-height: 1.8;
}

.ai-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 32px;
}
.ai-suggestions button {
  border: 1px solid #dce6ee;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
  color: #182b3e;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}
.ai-suggestions button:hover {
  border-color: #8cc4e2;
  background: #f5fbff;
}
.ai-suggestions button span {
  font-size: 10px;
  color: #007ab6;
  font-weight: 700;
}
.ai-suggestions button strong {
  display: block;
  font-size: 13px;
  margin: 13px 0 6px;
  font-weight: 600;
}
.ai-suggestions button small {
  display: block;
  font-size: 11px;
  color: #596b7c;
  line-height: 1.7;
}

.ai-compose-area {
  padding: 0 40px max(16px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 940px;
  margin: auto;
}

.ai-composer {
  border: 1px solid #c6d8e5;
  border-radius: 18px;
  padding: 14px 16px 10px;
  background: #fff;
  box-shadow: 0 4px 24px rgba(25, 73, 108, 0.05);
}
.ai-composer:focus-within {
  border-color: #007ab6;
  box-shadow: 0 0 0 3px #e7f3fb;
}
.ai-composer textarea {
  display: block;
  width: 100%;
  min-height: 38px;
  max-height: 130px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: #182b3e;
  font-size: 14px;
  padding: 0;
  line-height: 1.7;
}
.ai-composer textarea::placeholder {
  color: #657b8e;
}

.ai-composer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.ai-composer__bottom > span {
  font-size: 10px;
  color: #596b7c;
}

.ai-workspace .ai-composer textarea:focus-visible {
  outline: 0;
}

.ai-send {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 11px;
  background: #007ab6;
  color: #fff;
}
.ai-send:hover {
  background: #006397;
}
.ai-send svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ai-disclosure {
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
  margin: 10px auto 0;
  color: #596b7c;
  max-width: 680px;
}

.ai-context {
  padding: 10px 32px;
  background: #f3f8fc;
  border-bottom: 1px solid #dce6ee;
  font-size: 12px;
}
.ai-context span {
  color: #596b7c;
  margin-right: 10px;
}
.ai-context strong {
  font-weight: 600;
}

.ai-notice {
  background: #fff8e9;
  color: #70521c;
  padding: 12px 24px;
  border-bottom: 1px solid #efe0c3;
  font-size: 13px;
}

.ai-error {
  color: #a03735;
  font-size: 13px;
  margin: 0 0 8px;
}

.ai-human {
  font-size: 12px;
  display: inline-block;
  margin-bottom: 9px;
  text-decoration: none;
}

.ai-messages {
  max-width: 780px;
  margin: auto;
}

.ai-message {
  display: flex;
  gap: 12px;
  margin: 0 0 25px;
  align-items: flex-start;
  overflow-wrap: anywhere;
}
.ai-message .ai-avatar {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
}

.ai-message__body {
  min-width: 0;
  max-width: 100%;
}
.ai-message__body > strong {
  display: block;
  color: #526c80;
  font-size: 11px;
  margin-bottom: 7px;
  font-weight: 600;
}
.ai-message__body > p {
  white-space: pre-wrap;
  margin: 0;
  font-size: 14px;
  line-height: 1.85;
}
.ai-message__body > time {
  color: #65798a;
  font-size: 10px;
  display: block;
  margin-top: 8px;
}

.ai-message--user {
  justify-content: flex-end;
}
.ai-message--user .ai-avatar {
  display: none;
}
.ai-message--user .ai-message__body {
  max-width: 85%;
  background: #eaf4fb;
  border: 1px solid #dcebf6;
  border-radius: 17px 17px 4px 17px;
  padding: 12px 17px;
}
.ai-message--user .ai-message__body > strong {
  color: #46657d;
}

.ai-message--failed .ai-message__body > p {
  color: #a03735;
}

.ai-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.ai-result {
  border: 1px solid #dce6ee;
  border-radius: 13px;
  padding: 14px;
  background: #fff;
}
.ai-result h2 {
  font-size: 14px;
  line-height: 1.5;
  margin: 0 0 6px;
  font-weight: 600;
}
.ai-result p {
  margin: 0 0 10px;
  font-size: 12px;
  color: #596b7c;
}
.ai-result a {
  display: inline-block;
  font-size: 12px;
  margin: 4px 12px 4px 0;
  text-decoration: none;
}
.ai-result a:hover {
  text-decoration: underline;
}

.ai-text-button {
  background: transparent;
  border: 0;
  padding: 10px;
  color: #007ab6;
  font-size: 12px !important;
  text-align: center;
}

.ai-older {
  display: block;
  margin: 0 auto 24px;
}

.ai-thinking {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 780px;
  margin: 10px auto;
  color: #596b7c;
}
.ai-thinking > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #007ab6;
  animation: ai-pulse 1s infinite alternate;
}
.ai-thinking > span:nth-child(2) {
  animation-delay: 0.2s;
}
.ai-thinking > span:nth-child(3) {
  animation-delay: 0.4s;
}
.ai-thinking small {
  margin-left: 8px;
  font-size: 12px;
}

@keyframes ai-pulse {
  from {
    opacity: 0.3;
  }
  to {
    opacity: 1;
  }
}
.ai-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ai-float {
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182b3e;
}

.ai-float__launcher {
  position: fixed;
  right: 22px;
  bottom: 96px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #fff;
  border-radius: 28px;
  background: #007ab6;
  color: #fff;
  padding: 13px 17px;
  z-index: 1030;
  box-shadow: 0 6px 22px rgba(0, 83, 130, 0.22);
  transition: background 0.2s;
}
.ai-float__launcher:hover {
  background: #005f93;
}
.ai-float__launcher svg {
  width: 25px;
  height: 25px;
}
.ai-float__launcher span {
  font-weight: 650;
  font-size: 13px;
}

.ai-float__dialog {
  position: fixed;
  inset: auto 22px calc(166px + env(safe-area-inset-bottom)) auto;
  margin: 0;
  width: min(420px, 100vw - 32px);
  height: min(620px, 100dvh - 200px);
  max-height: none;
  max-width: none;
  border: 1px solid #dce6ee;
  border-radius: 22px;
  padding: 0;
  background: #fff;
  color: #182b3e;
  overflow: hidden;
  box-shadow: 0 18px 70px rgba(23, 55, 82, 0.2);
}
.ai-float__dialog::backdrop {
  background: rgba(15, 37, 57, 0.12);
}
.ai-float__dialog > header {
  height: 52px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid #dce6ee;
  background: #f6faff;
}
.ai-float__dialog > header strong {
  flex: 1;
  font-size: 12px;
}
.ai-float__dialog > header a, .ai-float__dialog > header button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  text-decoration: none;
  color: #596b7c;
  background: transparent;
  font-size: 22px;
}
.ai-float__dialog > header a:hover, .ai-float__dialog > header button:hover {
  background: #e2eef7;
}
.ai-float__dialog iframe {
  width: 100%;
  height: calc(100% - 52px);
  border: 0;
  display: block;
}

.ai-float__welcome {
  padding: 32px 26px;
}
.ai-float__welcome h2 {
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: -0.6px;
  margin: 25px 0 15px;
}
.ai-float__welcome p {
  font-size: 14px;
  color: #596b7c;
}
.ai-float__welcome > small {
  display: block;
  font-size: 11px;
  color: #596b7c;
  margin-top: 18px;
}

.ai-primary-link {
  display: block;
  text-decoration: none;
  text-align: center;
  padding: 13px 16px;
  margin-top: 24px;
  border-radius: 12px;
  color: #fff !important;
  background: #007ab6;
  font-weight: 600;
}
.ai-primary-link:hover {
  background: #006397;
}

.ai-page--embedded .ai-workspace {
  grid-template-columns: minmax(0, 1fr);
}
.ai-page--embedded .ai-sidebar, .ai-page--embedded .ai-mobile-menu {
  display: none;
}
.ai-page--embedded .ai-header {
  padding: 12px 16px;
}
.ai-page--embedded .ai-header__identity h1 {
  font-size: 13px;
}
.ai-page--embedded .ai-scroll {
  padding: 18px;
}
.ai-page--embedded .ai-welcome {
  margin-top: 5px;
}
.ai-page--embedded .ai-welcome h2 {
  font-size: 27px;
}
.ai-page--embedded .ai-eyebrow {
  margin-top: 15px;
}
.ai-page--embedded .ai-suggestions {
  grid-template-columns: 1fr;
  margin-top: 20px;
  gap: 8px;
}
.ai-page--embedded .ai-suggestions button {
  padding: 10px 12px;
}
.ai-page--embedded .ai-suggestions button > span {
  float: left;
  margin-right: 10px;
}
.ai-page--embedded .ai-suggestions button strong {
  margin: 0;
}
.ai-page--embedded .ai-suggestions button small {
  margin-left: 24px;
}
.ai-page--embedded .ai-welcome__mark {
  display: none;
}
.ai-page--embedded .ai-compose-area {
  padding: 0 12px 10px;
}
.ai-page--embedded .ai-disclosure {
  font-size: 9px;
}
.ai-page--embedded .ai-key-hint {
  display: none;
}
.ai-page--embedded .ai-cards {
  grid-template-columns: 1fr;
}

@media (max-width: 767px) {
  .ai-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
  .ai-sidebar {
    display: none;
    position: fixed;
    inset: 76px 20% 0 0;
    z-index: 20;
    box-shadow: 20px 0 60px rgba(24, 43, 62, 0.1450980392);
  }
  .ai-workspace--history .ai-sidebar {
    display: flex;
  }
  .ai-mobile-menu {
    display: inline-flex;
  }
  .ai-header {
    padding: 14px 16px;
    gap: 10px;
  }
  .ai-header__identity {
    flex: 1;
    gap: 8px;
  }
  .ai-header__identity h1 {
    font-size: 14px;
  }
  .ai-header__identity .ai-avatar {
    display: none;
  }
  .ai-header__identity p {
    font-size: 10px;
  }
  .ai-scroll {
    padding: 22px 18px;
  }
  .ai-welcome {
    margin: 12px 0 20px;
  }
  .ai-welcome h2 {
    font-size: 33px;
  }
  .ai-welcome > p {
    font-size: 13px;
  }
  .ai-suggestions {
    grid-template-columns: 1fr;
    margin-top: 24px;
    gap: 9px;
  }
  .ai-suggestions button {
    padding: 12px 15px;
  }
  .ai-suggestions button > span {
    float: left;
    margin: 0 12px 0 0;
  }
  .ai-suggestions button strong {
    margin: 0;
  }
  .ai-suggestions button small {
    margin-left: 25px;
  }
  .ai-compose-area {
    padding: 0 14px max(12px, env(safe-area-inset-bottom));
  }
  .ai-key-hint {
    display: none;
  }
  .ai-composer textarea {
    font-size: 16px;
  }
  .ai-disclosure {
    font-size: 9px;
  }
  .ai-context {
    padding: 10px 16px;
    font-size: 11px;
  }
  .ai-cards {
    grid-template-columns: 1fr;
  }
  .ai-message {
    gap: 8px;
  }
  .ai-float__launcher {
    right: 16px;
    padding: 12px 14px;
  }
  .ai-float__dialog {
    right: 16px;
    bottom: calc(162px + env(safe-area-inset-bottom));
    height: min(620px, 100dvh - 185px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ai-workspace *, .ai-float * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
