:root {
  --orange-50: #fff7ed;
  --orange-100: #ffedd5;
  --orange-200: #fed7aa;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --orange-700: #c2410c;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #f3f4f6;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, rgba(249, 115, 22, 0.14), transparent 25%),
    radial-gradient(circle at 92% 92%, rgba(234, 88, 12, 0.1), transparent 30%),
    #fffaf5;
  color: var(--ink);
}

button,
textarea {
  font: inherit;
}

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

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
  pointer-events: none;
}

.ambient-one {
  top: 7%;
  left: 4%;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(249, 115, 22, 0.16);
}

.ambient-two {
  right: 4%;
  bottom: 8%;
  width: 180px;
  height: 180px;
  background: rgba(254, 215, 170, 0.16);
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.chat-shell {
  width: min(1080px, 100%);
  height: min(900px, calc(100vh - 56px));
  min-height: 680px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid rgba(234, 88, 12, 0.12);
  border-radius: 28px;
  box-shadow: 0 28px 80px rgba(154, 52, 18, 0.13), 0 6px 20px rgba(31, 41, 55, 0.06);
}

.chat-header {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 28px 32px 26px;
  color: var(--white);
  background: linear-gradient(135deg, var(--orange-600) 0%, var(--orange-500) 58%, #fb923c 100%);
}

.chat-header::before,
.chat-header::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.chat-header::before {
  width: 240px;
  height: 240px;
  top: -170px;
  right: 14%;
}

.chat-header::after {
  width: 120px;
  height: 120px;
  right: -28px;
  bottom: -70px;
}

.header-copy,
.header-tools {
  position: relative;
  z-index: 1;
}

.header-copy {
  min-width: 0;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font-size: 23px;
  font-weight: 850;
  letter-spacing: -0.05em;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.82;
}

h1 {
  margin: 0;
  font-size: clamp(23px, 3vw, 31px);
  line-height: 1.12;
  letter-spacing: -0.035em;
}

.subtitle {
  max-width: 720px;
  margin: 14px 0 0 62px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
}

.header-tools {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff7ed;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.language-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.language-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.74);
}

.language-buttons {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  background: rgba(130, 42, 8, 0.16);
}

.language-button {
  min-width: 34px;
  padding: 5px 7px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 850;
  cursor: pointer;
  transition: 160ms ease;
}

.language-button:hover {
  color: var(--white);
}

.language-button.is-active {
  background: var(--white);
  color: var(--orange-700);
  box-shadow: 0 2px 8px rgba(124, 45, 18, 0.18);
}

.language-button:focus-visible,
.prompt-chip:focus-visible,
.send-button:focus-visible,
.lock-reset-button:focus-visible,
.demo-login-button:focus-visible,
.demo-password-row input:focus-visible {
  outline: 3px solid rgba(255, 237, 213, 0.78);
  outline-offset: 3px;
}

.lock-reset-button {
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: 160ms ease;
}

.lock-reset-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.prototype-notice {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 32px;
  border-bottom: 1px solid var(--orange-100);
  background: linear-gradient(90deg, #fff7ed, #fffaf7);
  color: #7c2d12;
  font-size: 12px;
  line-height: 1.45;
}

.prototype-notice div {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
}

.prototype-notice strong {
  color: var(--orange-700);
}

.prototype-notice span:not(.notice-icon) {
  color: #9a3412;
}

.notice-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-500);
  color: var(--white);
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 700;
}

.chat-messages {
  flex: 1;
  min-height: 170px;
  overflow-y: auto;
  padding: 26px 32px 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at 15% 20%, var(--orange-100), transparent 35%);
  scrollbar-color: var(--orange-200) transparent;
  scrollbar-width: thin;
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  margin-bottom: 16px;
}

.message.user {
  justify-content: flex-end;
}

.message.bot {
  justify-content: flex-start;
}

.assistant-avatar,
.message.bot:not(:first-child)::before {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--orange-100);
  color: var(--orange-700);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.message.bot:not(:first-child)::before {
  content: "JPV";
}

.bubble {
  max-width: min(76%, 720px);
  padding: 14px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.6;
  text-align: left;
  white-space: pre-wrap;
}

.intro-bubble {
  white-space: normal;
}

.message-label {
  display: block;
  margin-bottom: 6px;
  color: var(--orange-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bubble p {
  margin: 0;
  white-space: normal;
}

.bubble p + p {
  margin-top: 8px;
  color: var(--muted);
}

.message.user .bubble {
  border-bottom-right-radius: 5px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: 0 8px 20px rgba(234, 88, 12, 0.18);
  color: var(--white);
}

.message.bot .bubble {
  border: 1px solid #f1e8e1;
  border-bottom-left-radius: 5px;
  background: var(--white);
  box-shadow: 0 5px 16px rgba(31, 41, 55, 0.055);
  color: var(--ink);
}

.prompt-panel {
  flex: 0 0 auto;
  padding: 14px 20px 12px;
  border-top: 1px solid var(--line);
  background: var(--white);
}

.prompt-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 4px 9px;
}

.prompt-heading > span {
  color: #374151;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-heading small {
  color: #9ca3af;
  font-size: 10px;
}

.quick-prompts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.prompt-chip {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border: 1px solid var(--orange-200);
  border-radius: 13px;
  background: var(--orange-50);
  color: #7c2d12;
  font-size: 11px;
  font-weight: 750;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.prompt-chip:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #fdba74;
  background: var(--white);
  box-shadow: 0 5px 14px rgba(234, 88, 12, 0.09);
}

.prompt-chip:disabled {
  opacity: 0.55;
  cursor: wait;
}

.chat-shell.is-demo-locked .prompt-chip:disabled,
.chat-shell.is-demo-locked .send-button:disabled,
.chat-shell.is-demo-locked textarea:disabled {
  cursor: not-allowed;
}

.prompt-number {
  flex: 0 0 auto;
  color: var(--orange-500);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.chat-form {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 0 20px 20px;
  background: var(--white);
}

.input-wrap {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 8px 7px 15px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fcfcfc;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap:focus-within {
  border-color: #fb923c;
  background: var(--white);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.1);
}

textarea {
  min-height: 28px;
  max-height: 88px;
  min-width: 0;
  flex: 1;
  resize: none;
  overflow-y: auto;
  padding: 4px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

textarea::placeholder {
  color: #9ca3af;
}

textarea:disabled {
  cursor: wait;
}

.input-hint {
  flex: 0 0 auto;
  padding-right: 4px;
  color: #9ca3af;
  font-size: 9px;
  white-space: nowrap;
}

.send-button {
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: 0 8px 18px rgba(234, 88, 12, 0.2);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.send-button svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.send-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 11px 22px rgba(234, 88, 12, 0.25);
  filter: saturate(1.08);
}

.send-button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.source-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--orange-100);
}

.source-title {
  margin: 0 0 8px;
  color: var(--orange-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-item {
  position: relative;
  overflow: hidden;
  padding: 12px 13px 12px 16px;
  border: 1px solid #f1e4d8;
  border-radius: 12px;
  background: #fffaf6;
}

.source-item::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--orange-500), var(--orange-600));
}

.source-item + .source-item {
  margin-top: 8px;
}

.source-name {
  color: #431407;
  font-size: 13px;
  font-weight: 800;
}

.source-label {
  margin-top: 8px;
  color: #9a3412;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.source-path,
.source-file {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

.source-link {
  display: inline-flex;
  align-items: center;
  margin-top: 9px;
  color: var(--orange-600);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.source-link::after {
  content: "↗";
  margin-left: 5px;
}

.source-link:hover {
  color: var(--orange-700);
  text-decoration: underline;
}

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

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

.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--orange-500);
  animation: typing-dot 1s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.demo-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(67, 20, 7, 0.42);
  backdrop-filter: blur(12px);
}

.demo-lock-overlay[hidden] {
  display: none;
}

.demo-lock-panel {
  width: min(430px, 100%);
  padding: 30px;
  border: 1px solid rgba(234, 88, 12, 0.16);
  border-radius: 24px;
  background: linear-gradient(180deg, var(--white), #fff8f1);
  box-shadow: 0 28px 80px rgba(67, 20, 7, 0.22), 0 8px 24px rgba(31, 41, 55, 0.08);
}

.demo-lock-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  color: var(--white);
  font-size: 25px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(234, 88, 12, 0.24);
}

.demo-lock-eyebrow {
  margin: 20px 0 7px;
  color: var(--orange-700);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.demo-lock-panel h2 {
  margin: 0;
  color: #431407;
  font-size: 28px;
  line-height: 1.12;
}

.demo-lock-copy {
  margin: 10px 0 22px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.demo-login-form label {
  display: block;
  margin-bottom: 8px;
  color: #7c2d12;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-password-row {
  display: flex;
  gap: 9px;
}

.demo-password-row input {
  min-width: 0;
  flex: 1;
  padding: 12px 13px;
  border: 1px solid var(--orange-200);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.demo-password-row input:focus-visible {
  border-color: #fb923c;
  outline-color: rgba(249, 115, 22, 0.2);
}

.demo-login-button {
  flex: 0 0 auto;
  padding: 0 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  box-shadow: 0 9px 20px rgba(234, 88, 12, 0.2);
  color: var(--white);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition: 160ms ease;
}

.demo-login-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(234, 88, 12, 0.26);
}

.demo-login-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.demo-lock-message {
  min-height: 20px;
  margin: 10px 0 0;
  color: #9a3412;
  font-size: 12px;
  line-height: 1.45;
}

.demo-lock-message[data-type="error"] {
  color: #b91c1c;
}

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

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

@media (max-width: 820px) {
  .quick-prompts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .input-hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .page {
    display: block;
    padding: 0;
  }

  .chat-shell {
    width: 100%;
    height: 100dvh;
    min-height: 560px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .chat-header {
    gap: 12px;
    padding: 18px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-size: 20px;
  }

  h1 {
    font-size: 20px;
  }

  .eyebrow {
    font-size: 9px;
  }

  .subtitle {
    margin: 10px 0 0;
    font-size: 12px;
  }

  .header-tools {
    gap: 9px;
  }

  .status-pill {
    padding: 7px 9px;
    font-size: 9px;
  }

  .language-control {
    gap: 5px;
  }

  .language-label {
    display: none;
  }

  .lock-reset-button {
    padding: 6px 8px;
    font-size: 9px;
  }

  .prototype-notice {
    align-items: flex-start;
    padding: 9px 18px;
    font-size: 10px;
  }

  .prototype-notice div {
    display: block;
  }

  .prototype-notice strong {
    display: block;
    margin-bottom: 1px;
  }

  .notice-icon {
    width: 18px;
    height: 18px;
  }

  .chat-messages {
    padding: 18px;
  }

  .bubble {
    max-width: 86%;
    padding: 12px 13px;
    font-size: 13px;
  }

  .assistant-avatar,
  .message.bot:not(:first-child)::before {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    font-size: 8px;
  }

  .prompt-panel {
    padding: 10px 12px 9px;
  }

  .prompt-heading {
    margin-bottom: 7px;
  }

  .quick-prompts {
    gap: 6px;
  }

  .prompt-chip {
    min-height: 42px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .prompt-number {
    display: none;
  }

  .chat-form {
    gap: 7px;
    padding: 0 12px 12px;
  }

  .input-wrap {
    padding-left: 12px;
    border-radius: 14px;
  }

  textarea {
    font-size: 13px;
  }

  .send-button {
    min-width: 48px;
    padding: 0 14px;
    border-radius: 14px;
  }

  .send-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .demo-lock-overlay {
    padding: 18px;
  }

  .demo-lock-panel {
    padding: 22px;
    border-radius: 20px;
  }

  .demo-lock-panel h2 {
    font-size: 23px;
  }

  .demo-password-row {
    flex-direction: column;
  }

  .demo-login-button {
    min-height: 44px;
  }
}

@media (max-height: 720px) and (min-width: 641px) {
  .chat-shell {
    min-height: 620px;
  }

  .chat-header {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .prototype-notice {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .chat-messages {
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
