:root {
  --rv-primary-900: #23008a;
  --rv-primary-800: #3a0cc0;
  --rv-primary-600: #5e2cf2;
  --rv-neutral-900: #212121;
  --elyxta-bg: #fcfffd;
  --elyxta-primary: #2a57f2;
  --elyxta-text: #001355;
  --elyxta-placeholder: rgba(42, 87, 242, 0.6);
  --elyxta-chip-bg: rgba(42, 87, 242, 0.1);
  --elyxta-chip-text: rgba(0, 19, 85, 0.48);
  --font-body: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto,
    Ubuntu, Oxygen, Cantarell, "Microsoft Sans Serif", Arial, sans-serif;
  --font-display: "Unbounded", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  color: var(--rv-neutral-900);
  font-family: var(--font-body);
  background:
    radial-gradient(72% 44% at 50% -4%, rgba(94, 44, 242, 0.2) 0%, transparent 68%),
    linear-gradient(180deg, #f7f5ff 0%, #fbfaff 38%, #ffffff 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.site-header {
  width: 100%;
  background: linear-gradient(145deg, var(--rv-primary-600), var(--rv-primary-800));
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

.site-header-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: center;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-link img {
  width: 140px;
  height: auto;
  display: block;
}

.hero {
  padding: 22px 16px 28px;
  display: flex;
  justify-content: center;
}

.legal-main {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 16px 28px;
}

.card {
  background: #ffffff;
  border: 1px solid rgba(42, 87, 242, 0.16);
  border-radius: 14px;
  box-shadow: 0 10px 36px rgba(42, 87, 242, 0.06);
  padding: 22px 20px;
}

.card h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.18;
  color: var(--rv-primary-600);
}

.card h2 {
  margin: 26px 0 8px;
  color: var(--rv-primary-600);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1.3;
}

.card p,
.card li,
.card td {
  color: #5a657d;
}

.card p,
.card li,
.card td,
.card th {
  font-size: 15px;
  line-height: 1.6;
}

.card ul {
  padding-left: 20px;
}

.card a {
  color: var(--elyxta-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.meta {
  margin: 0;
}

.top-nav {
  margin-top: 18px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--rv-primary-600);
}

.card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.card th,
.card td {
  border: 1px solid rgba(42, 87, 242, 0.16);
  padding: 8px;
  text-align: left;
  vertical-align: top;
}

.card th {
  background: #f2f4fd;
  color: #2e3550;
  font-weight: 600;
}

.elyxta-chat-form {
  width: min(1120px, 100%);
  background: var(--elyxta-bg);
  border: 1px solid rgba(42, 87, 242, 0.12);
  border-radius: 20px;
  box-shadow: 0 10px 36px rgba(42, 87, 242, 0.1);
  padding: 20px 30px 26px;
  font-family: var(--font-display);
}

.elyxta-chat-form h1 {
  margin: 0;
  color: var(--rv-primary-600);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.2vw, 36px);
  font-weight: 700;
  line-height: 1.18;
}

.subheadline {
  margin: 10px 0 18px;
  color: rgba(0, 19, 85, 0.7);
  font-family: var(--font-display);
  font-size: clamp(13px, 2vw, 16px);
  font-weight: 300;
  line-height: 1.38;
}

.chat-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.chat-form textarea {
  width: 100%;
  min-height: 96px;
  border: 1.5px solid rgba(42, 87, 242, 0.3);
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 1px 2px rgba(13, 26, 62, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 14px 16px;
  resize: vertical;
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 18px;
  line-height: 1.11;
  color: var(--elyxta-text);
}

.chat-form textarea::placeholder {
  color: var(--elyxta-placeholder);
}

.chat-form textarea:focus {
  outline: none;
  border-color: var(--elyxta-primary);
  box-shadow:
    0 0 0 3px rgba(42, 87, 242, 0.15),
    0 1px 2px rgba(13, 26, 62, 0.08);
}

.input-meta {
  margin-top: -4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: rgba(0, 19, 85, 0.58);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
}

.input-meta.is-limit {
  color: #cf1322;
}

.quick-prompts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.quick-prompts span {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  color: rgba(0, 19, 85, 0.56);
}

.quick-prompts-list {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
}

.quick-prompts-list button {
  height: 24px;
  border: none;
  border-radius: 20px;
  background: var(--elyxta-chip-bg);
  color: var(--elyxta-chip-text);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 300;
  line-height: 24px;
  padding: 0 16px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.quick-prompts-list button:hover {
  background: rgba(42, 87, 242, 0.18);
  color: rgba(0, 19, 85, 0.7);
}

.chat-send {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border: none;
  padding: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.chat-send:hover:enabled {
  opacity: 0.72;
}

.chat-send:active:enabled {
  transform: scale(0.96);
}

.chat-send:disabled {
  opacity: 0.44;
  cursor: default;
}

.chat-send-icon {
  width: 62px;
  height: 62px;
  display: block;
}

.chat-send-text {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}

.review-output {
  margin-top: 16px;
  border-radius: 14px;
  border: 1px solid rgba(42, 87, 242, 0.22);
  background: rgba(42, 87, 242, 0.04);
  padding: 14px 16px;
}

.review-output h2 {
  margin: 0;
  color: var(--elyxta-primary);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
}

.review-markdown {
  margin-top: 8px;
  color: #111111;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.54;
}

.review-markdown > :first-child {
  margin-top: 0;
}

.review-markdown > :last-child {
  margin-bottom: 0;
}

.review-markdown p {
  margin: 0 0 10px;
}

.review-markdown h1,
.review-markdown h2,
.review-markdown h3,
.review-markdown h4 {
  margin: 12px 0 6px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--elyxta-primary);
}

.review-markdown ul,
.review-markdown ol {
  margin: 0 0 10px;
  padding-left: 20px;
}

.review-markdown li {
  margin: 0 0 6px;
}

.review-markdown a {
  color: var(--elyxta-primary);
  text-decoration: underline;
}

.review-markdown code {
  background: rgba(42, 87, 242, 0.12);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 0.93em;
}

.review-markdown pre {
  overflow-x: auto;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(42, 87, 242, 0.08);
}

.review-markdown pre code {
  background: transparent;
  padding: 0;
}

.review-output.is-limit {
  border-color: rgba(207, 19, 34, 0.24);
  background: rgba(255, 241, 240, 0.9);
}

.review-output.is-limit h2 {
  color: #cf1322;
}

.remaining {
  margin: 10px 2px 0;
  color: #147d64;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.site-footer {
  margin-top: 26px;
  background: #1d1f2f;
  border-top: 1px solid #2f3148;
}

.footer-bottom {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px;
  color: #a5acc4;
  font-size: 12px;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-legal a {
  color: #d5dcf5;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

.footer-legal a:hover {
  color: #ffffff;
}

@media (max-width: 980px) {
  .elyxta-chat-form {
    padding: 16px 20px 20px;
  }

  .chat-form textarea {
    font-size: 16px;
  }

  .quick-prompts-list button {
    font-size: 13px;
  }
}

@media (max-width: 760px) {
  .site-header-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .logo-link img {
    width: 122px;
  }

  .elyxta-chat-form {
    padding: 12px 14px 16px;
  }

  .elyxta-chat-form h1 {
    font-size: 23px;
  }

  .subheadline {
    margin-bottom: 14px;
    font-size: 13px;
  }

  .chat-form textarea {
    min-height: 84px;
    font-size: 14px;
    padding: 12px 14px;
  }

  .message-row {
    gap: 8px;
  }

  .input-meta {
    font-size: 10px;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .quick-prompts {
    gap: 8px;
  }

  .quick-prompts-list {
    gap: 8px;
  }

  .quick-prompts-list button {
    font-size: 12px;
    padding: 0 12px;
  }

  .quick-prompts-list button:last-child {
    display: none;
  }

  .chat-send,
  .chat-send-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
  }

  .review-markdown {
    font-size: 14px;
  }

  .card {
    padding: 16px 14px;
  }

  .card p,
  .card li,
  .card td,
  .card th {
    font-size: 14px;
  }

  .footer-bottom {
    justify-content: center;
    text-align: center;
  }

  .footer-legal {
    justify-content: center;
    gap: 10px;
  }
}
