:root {
  --primary-gold: #CBA868;
  --primary-gold-dark: #B9944E;
  --secondary-grey: #777777;
  --background: #FFFFFF;
  --assistant-bg: #F8F8F8;
  --text: #222222;
  --muted: #8A8A8A;
  --border: rgba(20, 20, 20, 0.06);
  --glass-border: rgba(255, 255, 255, 0.72);
  --shadow-deep: 0 25px 70px rgba(20, 20, 20, 0.10);
  --shadow-soft: 0 12px 35px rgba(24, 24, 24, 0.05);
  --radius-xl: 30px;
  --radius-lg: 26px;
  --radius-md: 18px;
  font-family: Inter, Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(203, 168, 104, 0.10), transparent 34%),
    #f4f2ed;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.chat-container {
  width: min(960px, 100%);
  height: min(880px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(20, 20, 20, 0.06);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 25px 70px rgba(20, 20, 20, 0.10);
}

.chat-header {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 24px;
  border-bottom: 1px solid rgba(20, 20, 20, 0.06);
  background: rgba(255, 255, 255, 0.92);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 15px;
  background: white;
  box-shadow: 0 8px 24px rgba(203, 168, 104, 0.14);
}

.header-title h1 {
  margin: 0;
  color: #222;
  font-size: 27px;
  line-height: 1.1;
}

.header-title p {
  margin: 4px 0 0;
  color: #828282;
  font-size: 13px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(52, 168, 83, 0.2);
  border-radius: 999px;
  background: rgba(235, 253, 239, 0.9);
  color: #348b48;
  font-size: 13px;
  font-weight: 700;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22C55E;
  box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.12);
  animation: statusPulse 1.8s infinite ease-in-out;
}

.chat-scroll-area {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.chat-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.chat-scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.chat-scroll-area::-webkit-scrollbar-thumb {
  background: rgba(203, 168, 104, 0.45);
  border-radius: 999px;
}

.welcome-panel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  margin-bottom: 22px;
  border: 1px solid rgba(203, 168, 104, 0.22);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 35px rgba(24, 24, 24, 0.05);
  max-height: 220px;
  opacity: 1;
  overflow: hidden;
  transition:
    opacity 0.3s ease,
    max-height 0.35s ease,
    margin 0.35s ease,
    padding 0.35s ease;
}

.welcome-panel.is-dismissed {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-width: 0;
  opacity: 0;
  pointer-events: none;
}

.welcome-content {
  min-width: 0;
}

.welcome-label {
  margin: 0 0 4px;
  color: #a6813f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.welcome-content h2 {
  margin: 0 0 7px;
  color: #222;
  font-size: 22px;
  line-height: 1.25;
}

.welcome-content p:last-child {
  margin: 0;
  max-width: 650px;
  color: #707070;
  font-size: 14px;
  line-height: 1.6;
}

.welcome-icon {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  object-fit: contain;
  background: white;
  box-shadow: 0 6px 18px rgba(20, 20, 20, 0.07);
  flex: 0 0 auto;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.message-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
}

.message-row.user-message {
  justify-content: flex-end;
}

.message-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 11px;
  object-fit: contain;
  background: white;
  box-shadow: 0 6px 18px rgba(20, 20, 20, 0.07);
}

.message-content {
  display: flex;
  flex-direction: column;
  max-width: min(690px, 78%);
}

.user-message .message-content {
  align-items: flex-end;
  max-width: min(520px, 72%);
}

.message-bubble {
  padding: 14px 17px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.assistant-message .message-bubble {
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-top-left-radius: 6px;
  background: #fafafa;
  color: #303030;
}

.user-message .message-bubble {
  border-top-right-radius: 6px;
  background: linear-gradient(135deg, #cba868, #b68c45);
  color: white;
}

.message-time {
  margin-top: 5px;
  padding: 0 4px;
  color: #999;
  font-size: 11px;
}

.thinking-indicator {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 14px 0 18px 47px;
  color: #858585;
  font-size: 13px;
}

.thinking-indicator.is-visible {
  display: flex;
}

.thinking-pulse {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary-gold);
  box-shadow: 0 0 0 0 rgba(203, 168, 104, 0.42);
  animation: thinkingPulse 1.1s infinite ease-out;
}

.thinking-dots {
  display: inline-flex;
  gap: 5px;
}

.thinking-dots i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--primary-gold);
  animation: dotFloat 1s infinite ease-in-out;
}

.thinking-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.thinking-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.guided-options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0 22px 58px;
}

.guided-option {
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid rgba(203, 168, 104, 0.55);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #6f5527;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.guided-option:hover {
  transform: translateY(-1px);
  border-color: #cba868;
  background: #fffaf1;
  box-shadow: 0 8px 22px rgba(203, 168, 104, 0.15);
}

.guided-option:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.chat-input-container {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(20, 20, 20, 0.06);
  background: rgba(255, 255, 255, 0.96);
}

.input-shell {
  flex: 1;
}

#messageInput {
  width: 100%;
  height: 52px;
  box-sizing: border-box;
  padding: 0 18px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 16px;
  outline: none;
  background: #fafafa;
  color: #222;
  font-size: 15px;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

#messageInput:focus {
  border-color: rgba(203, 168, 104, 0.8);
  background: white;
  box-shadow: 0 0 0 4px rgba(203, 168, 104, 0.11);
}

#messageInput::placeholder {
  color: #A7A7A7;
}

#sendButton {
  height: 52px;
  min-width: 112px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 16px;
  background: #cba868;
  color: white;
  font-size: 14px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

#sendButton:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(203, 168, 104, 0.25);
  filter: saturate(1.05);
}

#sendButton:active:not(:disabled) {
  transform: translateY(0);
}

#sendButton:disabled {
  background: #d8d8d8;
  color: white;
  cursor: not-allowed;
}

#sendButton svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.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 statusPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(0.82);
    opacity: 0.72;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes thinkingPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(203, 168, 104, 0.42);
  }

  70% {
    box-shadow: 0 0 0 12px rgba(203, 168, 104, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(203, 168, 104, 0);
  }
}

@keyframes dotFloat {
  0%, 80%, 100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-5px);
  }
}

/* Recommendation Card Styles */
.recommendation-card {
  margin-top: 12px;
  padding: 18px 20px;
  background: #FFFFFF;
  border: 1px solid rgba(203, 168, 104, 0.35);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(34, 34, 34, 0.08);
  animation: riseIn 350ms ease-out both;
}

.recommendation-project-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-gold-dark);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.recommendation-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(229, 229, 229, 0.6);
}

.recommendation-detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recommendation-detail-row:first-child {
  padding-top: 0;
}

.recommendation-detail-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-grey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recommendation-detail-value {
  font-size: 14px;
  font-weight: 750;
  color: var(--text);
  text-align: right;
  max-width: 60%;
}

@media (max-width: 700px) {
  .app-shell {
    padding: 0;
  }

  .chat-container {
    width: 100%;
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .chat-header {
    min-height: 72px;
    padding: 12px 15px;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .header-title h1 {
    font-size: 22px;
  }

  .header-title p {
    font-size: 11px;
  }

  .status-badge {
    padding: 7px 9px;
    font-size: 11px;
  }

  .chat-scroll-area {
    padding: 16px;
  }

  .welcome-panel {
    padding: 16px;
  }

  .welcome-content h2 {
    font-size: 19px;
  }

  .message-content,
  .user-message .message-content {
    max-width: calc(100% - 46px);
  }

  .guided-options-container {
    margin-left: 0;
  }

  .guided-option {
    max-width: 100%;
  }

  .chat-input-container {
    padding: 11px;
  }

  #sendButton {
    min-width: 52px;
    width: 52px;
    padding: 0;
  }

  #sendButton span {
    display: none;
  }
}
/* Premium SAVI visual refinement */
.chat-container {
  border-color: rgba(203, 168, 104, 0.12);
  box-shadow: 0 28px 80px rgba(20, 20, 20, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.72) inset;
}
.chat-header { position: relative; z-index: 2; border-bottom-color: rgba(203, 168, 104, 0.12); box-shadow: 0 8px 26px rgba(24, 24, 24, 0.035); }
.brand-logo { border: 1px solid rgba(203, 168, 104, 0.12); box-shadow: 0 8px 24px rgba(203, 168, 104, 0.12), 0 0 0 5px rgba(203, 168, 104, 0.035); }
.header-title h1 { letter-spacing: -0.035em; }
.status-badge { min-height: 36px; border-color: rgba(52, 168, 83, 0.24); background: linear-gradient(180deg, #f4fff6, #eafbed); box-shadow: 0 6px 18px rgba(52, 168, 83, 0.08), 0 0 0 1px rgba(255, 255, 255, 0.8) inset; }
.welcome-panel { border-color: rgba(203, 168, 104, 0.34); background: radial-gradient(circle at 12% 15%, rgba(203, 168, 104, 0.075), transparent 34%), linear-gradient(145deg, #ffffff, #fffdfa); box-shadow: 0 16px 40px rgba(45, 37, 24, 0.065), 0 0 0 1px rgba(255, 255, 255, 0.84) inset; }
.welcome-label { color: var(--primary-gold-dark); }
.welcome-content h2 { letter-spacing: -0.025em; }
.welcome-icon, .message-avatar { border: 1px solid rgba(203, 168, 104, 0.1); box-shadow: 0 8px 22px rgba(34, 34, 34, 0.07), 0 0 0 4px rgba(203, 168, 104, 0.025); }
.assistant-message .message-bubble { border-color: rgba(20, 20, 20, 0.075); background: linear-gradient(145deg, #ffffff, #fafafa); box-shadow: 0 10px 28px rgba(24, 24, 24, 0.045), 0 0 0 1px rgba(255, 255, 255, 0.74) inset; }
.user-message .message-bubble { box-shadow: 0 10px 26px rgba(182, 140, 69, 0.2); }
.guided-options-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.guided-option { min-height: 46px; padding: 11px 18px; border-color: rgba(203, 168, 104, 0.66); background: linear-gradient(180deg, #ffffff, #fffefa); color: #705321; letter-spacing: -0.01em; box-shadow: 0 7px 18px rgba(203, 168, 104, 0.07), 0 0 0 1px rgba(255, 255, 255, 0.75) inset; }
.guided-option:focus-visible { outline: 3px solid rgba(203, 168, 104, 0.26); outline-offset: 2px; }
.chat-input-container { position: relative; z-index: 3; border-top-color: rgba(203, 168, 104, 0.12); background: rgba(255, 255, 255, 0.985); box-shadow: 0 -12px 30px rgba(24, 24, 24, 0.035); }
#messageInput { border-color: rgba(20, 20, 20, 0.11); background: linear-gradient(180deg, #fbfbfb, #f8f8f8); box-shadow: 0 5px 16px rgba(24, 24, 24, 0.035) inset; }
#sendButton:not(:disabled) { background: linear-gradient(145deg, #d2b171, #b98f49); box-shadow: 0 10px 24px rgba(185, 143, 73, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.2) inset; }

@media (max-width: 700px) {
  html, body { height: 100%; overflow: hidden; }
  body { min-height: 100dvh; background: #ffffff; }
  .app-shell { min-height: 100dvh; }
  .chat-container { height: 100dvh; min-height: 100dvh; box-shadow: none; }
  .chat-header { min-height: 76px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; flex: 0 0 auto; }
  .header-left { min-width: 0; gap: 11px; }
  .brand-logo { width: 44px; height: 44px; border-radius: 13px; }
  .header-title { min-width: 0; }
  .header-title h1 { font-size: 23px; }
  .header-title p { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
  .status-badge { min-height: 32px; padding: 7px 10px; font-size: 12px; }
  .status-dot { width: 8px; height: 8px; box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.1); }
  .chat-scroll-area { padding: 16px 16px 28px; overscroll-behavior: contain; scrollbar-width: none; }
  .chat-scroll-area::-webkit-scrollbar { display: none; }
  .welcome-panel { gap: 13px; margin-bottom: 22px; padding: 17px 16px; border-radius: 20px; }
  .welcome-icon { width: 46px; height: 46px; border-radius: 14px; }
  .welcome-label { margin-bottom: 5px; font-size: 11px; }
  .welcome-content h2 { margin-bottom: 8px; font-size: 20px; line-height: 1.2; }
  .welcome-content p:last-child { font-size: 14px; line-height: 1.55; }
  .chat-messages { gap: 16px; }
  .message-row { gap: 10px; }
  .message-avatar { width: 36px; height: 36px; flex-basis: 36px; border-radius: 12px; }
  .message-content, .user-message .message-content { max-width: calc(100% - 46px); }
  .message-bubble { padding: 14px 16px; border-radius: 19px; font-size: 15px; line-height: 1.62; }
  .assistant-message .message-bubble { border-top-left-radius: 7px; }
  .user-message .message-bubble { border-top-right-radius: 7px; }
  .message-time { margin-top: 6px; font-size: 11px; }
  .guided-options-container { width: 100%; margin: 12px 0 24px; }
  .guided-options-chips { width: 100%; display: grid; grid-template-columns: 1fr; gap: 9px; }
  .guided-option { width: 100%; min-height: 48px; padding: 11px 17px; font-size: 13px; text-align: left; }
  .thinking-indicator { margin-left: 46px; }
  .chat-input-container { gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); }
  #messageInput { height: 54px; padding: 0 17px; border-radius: 18px; font-size: 16px; }
  #sendButton { width: 54px; min-width: 54px; height: 54px; border-radius: 18px; }
  #sendButton svg { width: 20px; height: 20px; }
  .recommendation-card { padding: 16px; }
  .recommendation-detail-row { align-items: flex-start; gap: 12px; }
}