:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body.ai-body {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(202, 162, 68, .15), transparent 40%),
    radial-gradient(ellipse at 8% 8%, rgba(205, 175, 111, .14), transparent 31%),
    #efeee9;
  color: #25231d;
}
.ai-body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(91, 72, 31, .19) .65px, transparent .65px);
  background-size: 8px 8px;
  content: '';
  opacity: .12;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 75%);
}
.ai-header {
  position: relative;
  z-index: 2;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 max(24px, calc((100vw - 1120px) / 2));
  border-bottom: 1px solid rgba(50, 46, 34, .12);
  background: rgba(243, 242, 239, .82);
  backdrop-filter: blur(14px);
}
.ai-brand { color: #171715; font-size: 19px; font-weight: 780; letter-spacing: -.085em; text-decoration: none; }
.ai-brand span { color: #a7885c; }
.ai-back, .ai-language { color: #69665d; font-size: 10px; font-weight: 650; letter-spacing: .06em; text-decoration: none; }
.ai-back { margin-left: auto; }
.ai-back:hover { color: #382d14; }
.ai-language { padding: 9px 0 9px 10px; border: 0; background: transparent; cursor: pointer; }
.ai-language span { margin-inline: 4px; color: #ba9b55; }
.ai-main { display: grid; min-height: calc(100vh - 72px); min-height: calc(100svh - 72px); justify-items: center; align-content: center; gap: 20px; padding: clamp(22px, 5vw, 55px) 20px 32px; }
.ai-chat-window {
  position: relative;
  isolation: isolate;
  display: flex;
  width: min(900px, 100%);
  min-height: min(720px, calc(100svh - 150px));
  flex-direction: column;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid transparent;
  border-image: linear-gradient(135deg, #80621d, #f6dc8c 21%, #9c7828 43%, #fff0ad 62%, #88671f 81%, #e3c66d) 1;
  background:
    radial-gradient(ellipse at 52% -15%, rgba(199, 157, 61, .18), transparent 50%),
    linear-gradient(145deg, #171611, #211e17 55%, #171611);
  color: #eee5d2;
  box-shadow: 0 0 0 1px rgba(209, 174, 83, .2), 0 0 20px rgba(216, 180, 82, .22), 0 0 58px rgba(177, 135, 37, .16), 0 28px 80px rgba(34, 27, 13, .2);
}
.ai-chat-window::before {
  position: absolute;
  z-index: -1;
  inset: -24px;
  border-radius: 30px;
  background: radial-gradient(ellipse at 50% 16%, rgba(238, 195, 78, .38), rgba(179, 134, 36, .13) 48%, transparent 76%);
  content: '';
  filter: blur(27px);
  opacity: .72;
  pointer-events: none;
  animation: ai-aura 7s ease-in-out infinite;
}
.ai-chat-window::after {
  position: absolute;
  z-index: 0;
  inset: 10px;
  border: 1px solid rgba(224, 192, 112, .17);
  content: '';
  pointer-events: none;
}
.ai-chat-window > * { position: relative; z-index: 1; }
.ai-chat-top { display: flex; align-items: center; gap: 14px; padding-bottom: 21px; border-bottom: 1px solid rgba(218, 190, 121, .23); }
.ai-orbit { position: relative; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff0b0; }
.ai-orbit--small { width: 48px; height: 48px; background: radial-gradient(circle at 36% 28%, #f8e59f, #b68e35 45%, #493510 78%); box-shadow: 0 0 15px rgba(230, 190, 79, .5), 0 0 35px rgba(196, 148, 42, .26); }
.ai-orbit--small img { display: block; width: 42px; height: 42px; border: 1px solid rgba(255, 241, 192, .8); border-radius: 50%; object-fit: cover; }
.ai-orbit--small::before, .ai-orbit--small::after { position: absolute; inset: -5px; border: 1px solid rgba(230, 194, 100, .42); border-radius: 50%; content: ''; animation: ai-orbit 8s linear infinite; }
.ai-orbit--small::after { inset: -10px; border-color: rgba(230, 194, 100, .2); animation-direction: reverse; }
.ai-chat-identity { display: grid; gap: 5px; min-width: 0; }
.ai-chat-kicker { margin: 0; color: #f0d894; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.ai-chat-kicker span { padding-inline: 3px; color: #ab9252; }
.ai-chat-status { display: inline-flex; align-items: center; gap: 7px; color: #b9ad91; font-size: 10px; }
.ai-chat-status i { width: 6px; height: 6px; border-radius: 50%; background: #84ae79; box-shadow: 0 0 0 4px rgba(132, 174, 121, .12); }
.ai-new-chat { display: inline-flex; min-height: 36px; align-items: center; gap: 9px; margin-left: auto; padding: 0 11px; border: 1px solid rgba(218, 190, 121, .32); background: rgba(255, 255, 255, .025); color: #d7c9a7; cursor: pointer; font-size: 9px; font-weight: 700; letter-spacing: .05em; transition: border .2s, background .2s, color .2s; }
.ai-new-chat:hover { border-color: #dfc06a; background: rgba(222, 187, 93, .1); color: #fff0c2; }
.ai-new-chat span:last-child { color: #d7b451; font-size: 14px; }
.ai-messages { display: flex; min-height: 280px; max-height: 48vh; flex: 1; flex-direction: column; gap: 20px; overflow-y: auto; padding: 28px 4px 22px; scrollbar-color: #786333 transparent; scrollbar-width: thin; }
.ai-message { display: flex; max-width: min(82%, 700px); align-items: flex-start; gap: 10px; animation: ai-rise .28s ease-out both; }
.ai-message--user { align-self: flex-end; flex-direction: row-reverse; }
.ai-message-orb { display: grid; width: 27px; height: 27px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(218, 190, 121, .44); border-radius: 50%; background: rgba(190, 151, 61, .12); color: #e7c968; font-size: 12px; }
.ai-message--user .ai-message-orb { border-color: rgba(215, 207, 187, .27); background: rgba(230, 224, 209, .09); color: #d9d0bd; }
.ai-message-avatar { display: block; width: 27px; height: 27px; flex: 0 0 auto; border: 1px solid rgba(218, 190, 121, .48); border-radius: 50%; object-fit: cover; }
.ai-message-content { min-width: 0; padding: 12px 15px; border: 1px solid rgba(218, 190, 121, .24); background: rgba(245, 235, 205, .055); color: #e8e0ce; }
.ai-message--user .ai-message-content { border-color: rgba(214, 191, 128, .29); background: rgba(177, 139, 50, .17); color: #fff0ce; }
.ai-message-name { display: block; margin-bottom: 5px; color: #d9bd69; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.ai-message--user .ai-message-name { color: #d7c59a; text-align: right; }
.ai-message-content p { margin: 0; font: 14px/1.75 Georgia, 'Times New Roman', serif; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-message--error .ai-message-content { border-color: rgba(219, 134, 113, .35); color: #efc0b1; }
.ai-typing { display: inline-flex; align-items: center; gap: 5px; min-height: 16px; }
.ai-typing i { width: 5px; height: 5px; border-radius: 50%; background: #dfc06a; animation: ai-dot 1s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: .14s; }
.ai-typing i:nth-child(3) { animation-delay: .28s; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 17px; }
.ai-suggestions button { display: inline-flex; min-height: 34px; align-items: center; gap: 9px; padding: 0 11px; border: 1px solid rgba(218, 190, 121, .25); background: rgba(255, 255, 255, .025); color: #cfc2a0; cursor: pointer; font-size: 9px; transition: border .2s, background .2s, color .2s; }
.ai-suggestions button:hover { border-color: #cfad55; background: rgba(190, 151, 61, .1); color: #fff0c2; }
.ai-suggestions button span:last-child { color: #d7b451; }
.ai-composer { display: flex; align-items: flex-end; gap: 10px; padding: 9px; border: 1px solid rgba(225, 194, 112, .52); background: #201e18; box-shadow: 0 0 18px rgba(206, 165, 62, .08); }
.ai-composer:focus-within { border-color: #e1c367; box-shadow: 0 0 0 3px rgba(205, 176, 94, .12), 0 0 24px rgba(206, 165, 62, .14); }
.ai-composer textarea { display: block; width: 100%; min-height: 42px; max-height: 150px; padding: 11px 8px; resize: none; border: 0; outline: 0; background: transparent; color: #f2ead9; font: 13px/1.6 Inter, ui-sans-serif, system-ui, sans-serif; }
.ai-composer textarea::placeholder { color: #a99f88; }
.ai-composer button { display: inline-flex; min-height: 40px; flex: 0 0 auto; align-items: center; gap: 12px; padding: 0 13px; border: 1px solid #e0c16b; background: linear-gradient(135deg, #d6b758, #a5812d); color: #211a0d; cursor: pointer; font-size: 8px; font-weight: 850; letter-spacing: .12em; transition: transform .2s, filter .2s; }
.ai-composer button:hover { transform: translateY(-1px); filter: brightness(1.12); }
.ai-composer button:disabled { cursor: wait; opacity: .55; transform: none; }
.ai-composer button span:last-child { font-size: 13px; }
.ai-footnote { margin: 10px 2px 0; color: #a79c81; font-size: 9px; line-height: 1.6; }
.ai-privacy-note { margin: 5px 2px 0; color: #89816f; font-size: 8px; line-height: 1.55; }
.ai-powered { margin: 0; color: #817b6a; font-size: 8px; font-weight: 750; letter-spacing: .16em; text-align: center; }
.ai-powered span { margin-inline: 5px; color: #b3923e; }
.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; }
@keyframes ai-aura { 0%, 100% { opacity: .52; transform: scale(.98); filter: blur(24px); } 50% { opacity: .92; transform: scale(1.02); filter: blur(34px); } }
@keyframes ai-orbit { to { transform: rotate(360deg); } }
@keyframes ai-rise { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ai-dot { 0%, 60%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 640px) {
  .ai-header { min-height: 62px; gap: 12px; padding-inline: 17px; }
  .ai-main { min-height: calc(100svh - 62px); padding: 13px 10px 20px; }
  .ai-chat-window { min-height: calc(100svh - 98px); padding: 19px 15px; }
  .ai-chat-window::after { inset: 7px; }
  .ai-chat-top { gap: 10px; padding-bottom: 16px; }
  .ai-orbit--small { width: 40px; height: 40px; }
  .ai-chat-kicker { font-size: 8px; letter-spacing: .1em; }
  .ai-chat-status { font-size: 9px; }
  .ai-new-chat { min-height: 33px; gap: 5px; padding-inline: 8px; font-size: 8px; }
  .ai-messages { min-height: 220px; max-height: 52vh; gap: 15px; padding: 21px 0 18px; }
  .ai-message { max-width: 95%; gap: 7px; }
  .ai-message-content { padding: 10px 12px; }
  .ai-message-content p { font-size: 13px; }
  .ai-suggestions { gap: 6px; }
  .ai-suggestions button { min-height: 32px; padding-inline: 8px; font-size: 8px; }
  .ai-composer { gap: 6px; padding: 6px; }
  .ai-composer button { min-height: 38px; gap: 7px; padding-inline: 9px; }
  .ai-footnote { font-size: 8px; }
}
@media (max-width: 380px) {
  .ai-back { font-size: 9px; }
  .ai-new-chat { max-width: 35px; overflow: hidden; white-space: nowrap; }
  .ai-new-chat span:first-child { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
