/* === RESET & BASE === */
html, body {
  margin: 0;
  padding: 0;
  background: #141110;
  color: #ffe9b6;
  font-family: 'Inter', 'Segoe UI', Arial, sans-serif;
  min-height: 100vh;
  width: 100vw;
  height: auto;
  overflow-x: auto;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: auto;
  overflow-x: auto;
}

/* === HEADER/NAV === */
.nav {
  width: 100vw;
  background: #181210;
  box-shadow: 0 2px 16px #ffb70022;
  min-height: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  z-index: 1001;
  position: fixed;
  top: 0;
  left: 0;
  padding: 0;
  box-sizing: border-box;
}

.brand {
  font-size: 1.26em;
  font-weight: 800;
  letter-spacing: 1px;
  padding-left: 32px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.brand a {
  text-decoration: none;
}

.brand-logo {
  height: 40px;
  width: 40px;
  margin-right: 8px;
  border-radius: 50%;
  background: #181110;
  border: 2px solid #ffb700bb;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}

.brand-glow {
  color: #ffb700;
  text-shadow: 0 0 14px #ffb700aa, 0 0 4px #ffe067;
  letter-spacing: 2px;
}

.sub {
  color: #fff3b0;
  font-size: 1.03em;
  margin-left: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.87;
  text-shadow: 0 0 10px #ffef9f40;
}

/* === MAIN CONTENT === */
main {
  width: 100vw;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: auto;
  height: auto;
  margin-top: 72px;
  margin-bottom: 78px;
  padding-left: 18px;
  padding-right: 18px;
  box-sizing: border-box;
}

/* === INDEX PAGE STYLES === */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  box-sizing: border-box;
}

.hero {
  background: rgba(30,22,7,0.97);
  border-radius: 1.5em;
  padding: 1.6em 1.3em 1.2em 1.3em;
  box-shadow: 0 8px 32px 0 #ffb70028, 0 0px 80px 0 #ffe06725;
  display: flex;
  flex-direction: column;
  gap: 1em;
  align-items: center;
  border: 1.8px solid #ffb700bb;
}

.hero img {
  width: 100%;
  max-width: 620px;
  border-radius: 1.2em;
  margin-bottom: 0.7em;
  display: block;
}

.hero h1 {
  font-size: clamp(1.2rem, 5vw, 2.05rem);
  color: #ffd700;
  margin: 0 0 0.1em 0;
  text-align: center;
  font-weight: 800;
  line-height: 1.13;
  text-shadow: 0 0 12px #ffd70055, 0 0 4px #ffec94a8;
}

.hero .lead {
  font-size: clamp(0.96rem, 2.2vw, 1.17rem);
  text-align: center;
  margin: 0 0 0.6em 0;
  color: #ffe5a1;
  font-weight: 500;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 0.36em;
  margin: 0 0 1em 0;
  padding: 0;
  list-style: none;
}

.features li {
  font-size: 1.06em;
  padding-left: 1.25em;
  position: relative;
  color: #ffde86;
}

.features li::before {
  content: "★";
  position: absolute;
  left: 0;
  color: #ffb700;
  font-size: 1.1em;
}

.cta-btn {
  background: linear-gradient(90deg, #ffb700 0%, #fff1a1 100%);
  color: #181c1f;
  padding: 0.65em 1.9em;
  border-radius: 2em;
  border: none;
  font-weight: bold;
  font-size: 1.08em;
  cursor: pointer;
  box-shadow: 0 1px 10px #0002;
  text-decoration: none;
  letter-spacing: 0.02em;
  margin-top: 0.3em;
  transition: background .18s, color .18s;
  display: inline-block;
}

.cta-btn:hover { 
  background: #ffb700; 
  color: #fffde9; 
}

.faq-section {
  background: rgba(30,22,7,0.97);
  border-radius: 1.1em;
  padding: 1.1em 1.3em 1.2em 1.3em;
  box-shadow: 0 8px 32px 0 #ffb70028, 0 0px 80px 0 #ffe06725;
  margin: 0;
  border: 1.8px solid #ffb700bb;
}

.faq-section h2 {
  color: #ffd700;
  font-size: 1.15em;
  margin-bottom: 0.7em;
  font-weight: 700;
  text-shadow: 0 0 12px #ffd70055, 0 0 4px #ffec94a8;
}

.faq-section dt {
  font-weight: bold;
  color: #ffe5a1;
  margin-top: 1em;
}

.faq-section dd {
  margin: 0 0 0.6em 0;
  color: #ffde86;
  font-size: 0.98em;
  line-height: 1.52;
}

/* === CHAT PAGE STYLES === */
.card {
  background: rgba(30,22,7,0.97);
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 #ffb70028, 0 0px 80px 0 #ffe06725;
  width: 100vw;
  max-width: 460px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  padding-bottom: 110px;
  overflow: visible;
  border: 1.8px solid #ffb700bb;
}

.chat-header {
  text-align: center;
  font-size: 1.21em;
  font-weight: 700;
  color: #ffda58;
  letter-spacing: .06em;
  margin-top: 18px;
  margin-bottom: 0px;
  padding: 11px 0 5px 0;
  border-bottom: 1.7px solid #ffb70044;
  background: none;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 1px 0 #ffebc117;
}

.gold-text {
  color: #ffd700;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-shadow: 0 0 12px #ffd70055, 0 0 4px #ffec94a8;
}

.chat-header .desc {
  display: block;
  color: #ffe5a1;
  font-weight: 500;
  font-size: 0.99em;
  margin-top: 5px;
  letter-spacing: 0.01em;
  opacity: 0.90;
}

#history {
  width: 100%;
  min-height: 350px;
  max-width: 100vw;
  overflow-x: auto;
  overflow-y: visible;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: none;
  word-break: break-word;
}

form {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 460px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  padding: 0 0 0 0;
  background: linear-gradient(0deg, #2b210e 90%, #ffb70012 100%);
  z-index: 110;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  box-shadow: 0 6px 32px #ffbf0011;
  border-top: 1.4px solid #ffdb7c44;
}

#q {
  flex: 1;
  font-size: 1em;
  background: #181110;
  color: #ffd969;
  border: 1.5px solid #ffb70080;
  border-radius: 11px;
  padding: 12px 12px 12px 16px;
  outline: none;
  box-shadow: 0 1px 6px #ffebc010;
  transition: box-shadow .16s, border .12s;
  min-width: 0;
  margin-right: 0;
}

#q:focus {
  box-shadow: 0 2px 14px #ffb70038;
  border: 1.7px solid #ffd700bb;
  background: #19120a;
  color: #fffbe7;
}

#btn {
  background: linear-gradient(90deg, #ffb700 0%, #fff1a1 100%);
  color: #181c1f;
  border: none;
  border-radius: 11px;
  font-size: 1.2em;
  padding: 0;
  height: 44px;
  min-width: 44px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity .15s, background .25s;
  box-shadow: 0 0 0 transparent;
}

#btn svg {
  width: 22px;
  height: 22px;
  display: block;
}

#btn:disabled {
  background: #554d2e;
  opacity: 0.45;
  cursor: not-allowed;
}

.bubble {
  margin: 10px 12px 6px 12px;
  padding: 12px 16px;
  border-radius: 16px;
  max-width: 96%;
  word-break: break-word;
  font-size: 1.08em;
  line-height: 1.7;
  letter-spacing: 0.01em;
  animation: fadein 0.5s;
  box-shadow: 0 2px 14px 0 #ffde9e0d;
  overflow-x: auto;
}

.bubble.user {
  background: linear-gradient(90deg, #ffd700 0%, #ffb700 100%);
  color: #181110;
  align-self: flex-end;
  font-weight: bold;
  border: 1.3px solid #ffe0878a;
}

.bubble.bot {
  background: rgba(50, 40, 16, 0.95);
  color: #ffde86;
  align-self: flex-start;
  border: 1.3px solid #ffd70044;
}

.bubble.error {
  background: #3a220c;
  color: #ffbdbd;
  border: 1px solid #f96;
}

.bubble.analyzing {
  background: rgba(52,44,25,0.90);
  color: #ffd700;
  align-self: flex-start;
  font-style: italic;
  font-size: 1.07em;
  letter-spacing: 0.04em;
  animation: pulse 1.2s infinite;
}

/* === FOOTER === */
.site-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 68px;
  z-index: 1001;
  box-sizing: border-box;
  background: #0a0807;
  border-top: 2px solid #ffb70044;
}

.footer-content {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  max-width: 500px;
  padding: 0 20px;
}

.footer-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #8a7a3f;
  text-decoration: none;
  font-size: 0.75em;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-width: 60px;
}

.footer-item:hover {
  color: #ffd700;
  background: rgba(255, 183, 0, 0.1);
}

.footer-item.active {
  color: #ffd700;
  background: rgba(255, 183, 0, 0.15);
}

.footer-item svg {
  width: 20px;
  height: 20px;
}

.footer-item span {
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* === GENERAL STYLES === */
a { 
  color: #ffd700; 
  text-decoration: underline; 
}

a:hover { 
  color: #fff1a1; 
  text-shadow: 0 0 8px #ffec944d; 
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: #393004; 
  border-radius: 3px;
}

::-webkit-scrollbar-track {
  background: #181110;
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* === MOBILE OPTIMIZATION === */
@media (max-width: 700px) {
  .nav { 
    min-height: 54px; 
    height: 54px;
  }
  
  .brand { 
    font-size: 1.05em; 
    padding-left: 10px; 
    height: 54px;
  }
  
  .brand-logo { 
    height: 30px; 
    width: 30px;
    object-fit: cover;
    flex-shrink: 0;
  }
  
  .sub { 
    font-size: .97em; 
  }
  
  main {
    margin-top: 60px;
    margin-bottom: 75px;
    padding-left: 7px;
    padding-right: 7px;
  }
  
  .container {
    gap: 1.1rem;
  }
  
  .hero, .faq-section { 
    padding: 1.1em 0.6em 0.7em 0.6em; 
    border-radius: 0.8em; 
  }
  
  .hero h1 { 
    font-size: clamp(1.04rem, 6vw, 1.28rem); 
  }
  
  .hero img { 
    max-width: 98vw; 
    border-radius: 0.7em; 
  }
  
  .features li { 
    font-size: 0.98em; 
  }
  
  .card {
    max-width: 100vw;
    width: 100vw;
    border-radius: 0;
    min-height: 0;
    height: auto;
    box-shadow: 0 8px 32px 0 #ffb70028;
    margin: 0;
    padding-bottom: 80px;
    border-left: none;
    border-right: none;
  }
  
  form {
    width: 100%;
    max-width: 100vw;
    left: 0;
    right: 0;
    border-radius: 0;
    position: absolute;
  }
  
  .site-footer {
    height: 65px;
  }
  
  .footer-nav {
    padding: 0 10px;
  }
  
  .footer-item {
    font-size: 0.7em;
    padding: 6px 8px;
    min-width: 50px;
  }
  
  .footer-item svg {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 450px) {
  .hero, .faq-section { 
    padding: 0.67em 0.1em 0.6em 0.2em; 
  }
  
  .hero h1 { 
    font-size: clamp(0.93rem, 8vw, 1.02rem); 
  }
  
  #btn { 
    font-size: 0.95em; 
    min-width: 38px; 
    width: 38px; 
  }
  
  .bubble { 
    font-size: .98em;
  }
  
  .footer-item {
    font-size: 0.65em;
    padding: 4px 6px;
    min-width: 45px;
  }
  
  .footer-item svg {
    width: 16px;
    height: 16px;
  }
}