:root{
  /* Light theme colors */
  --bg: #ffffff;
  --panel: #f4f6f8;
  --muted: #6b7280;
  --accent: #10a37f;
  --danger: #ef4444;
  --glass: rgba(0,0,0,0.04);
}

*{box-sizing:border-box}
html,body{height:100%;}
body{
  margin:0;
  font-family: Inter, 'Segoe UI', Roboto, Arial, sans-serif;
  background:var(--bg);
  color:#0f1720;
  -webkit-font-smoothing:antialiased;
}

.app{display:block;height:100vh}
.main{display:flex;flex-direction:column;min-height:100vh;margin-right:80px}

/* Accessibility helper: hide visually but keep for screen readers / SEO */
.visually-hidden{position:absolute!important;height:1px;width:1px;overflow:hidden;clip:rect(1px,1px,1px,1px);white-space:nowrap;border:0;padding:0;margin:-1px}

/* Right language menu */
.lang-menu{position:fixed;right:14px;top:20px;width:56px;background:transparent;display:flex;flex-direction:column;align-items:center;gap:8px;z-index:80}
.lang-menu .menu-top{display:flex;flex-direction:column;gap:6px;align-items:center}
.lang-menu h3{font-size:12px;color:var(--muted);margin:0}
.lang-btn{background:#fff;border:1px solid rgba(15,23,42,0.06);padding:6px 8px;border-radius:8px;font-size:12px;cursor:pointer}
.lang-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid rgba(0,0,0,0.06);background:linear-gradient(180deg, rgba(255,255,255,0.6), transparent)}
.branding h1{margin:0;font-size:18px}
.muted{color:var(--muted)}

.chat-area{flex:1;overflow:auto;padding:22px}
.messages{display:flex;flex-direction:column;gap:20px;max-width:820px;margin:0 auto;align-items:center}

/* Hero (home) centered input */
.hero{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:60vh;gap:20px}
.hero h2{font-size:clamp(18px, 2.4vw, 36px);color:var(--muted);font-weight:500;margin:0;text-align:center}
.hero-form{display:flex;align-items:center;gap:8px;width:640px;max-width:90%;background:#fff;border-radius:100px;padding:10px 14px;border:1px solid rgba(15,23,42,0.06);box-shadow:0 8px 30px rgba(15,23,42,0.06)}
.hero-form .hero-left{background:transparent;border:0;padding:6px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.hero-form input{flex:1;border:0;outline:none;padding:10px 8px;font-size:16px;color:#0f1720}
.hero-right{display:flex;gap:8px}
.hero-right .hero-submit{background:transparent;border:0;padding:6px;border-radius:8px;cursor:pointer}
.hero-right .icon.mic{background:transparent;border:0;padding:6px;border-radius:8px;cursor:pointer}

/* when messages exist, hide hero */
.hero.hidden{display:none}

/* Composer at bottom, centered pill */
.composer-scroll-wrap{position:fixed;left:50%;transform:translateX(-50%);bottom:120px;z-index:50;}
.composer-scroll{background:#fff;border:1px solid rgba(15,23,42,0.06);padding:8px;border-radius:999px;box-shadow:0 6px 18px rgba(15,23,42,0.06);cursor:pointer}

.composer{position:fixed;left:50%;transform:translateX(-50%);bottom:28px;z-index:60;display:flex;align-items:center;gap:10px;width:760px;max-width:94%;background:#fff;border-radius:999px;padding:10px 14px;border:1px solid rgba(15,23,42,0.06);box-shadow:0 18px 40px rgba(15,23,42,0.06)}
.composer input{flex:1;border:0;outline:none;padding:10px 12px;font-size:15px;color:#0f1720}
.composer .composer-left{background:transparent;border:0;padding:6px;border-radius:8px;cursor:pointer}
.composer .composer-right{display:flex;gap:8px}

/* Message alignment: bot left, user right */
.messages .msg{width:100%;display:flex}
.messages .msg.bot{justify-content:flex-start}
.messages .msg.user{justify-content:flex-end}
.bubble{max-width:64%;}

.msg{display:flex;gap:12px;align-items:flex-start}
.msg.user{justify-content:flex-end}
.bubble{padding:18px 20px;border-radius:12px;background:#ffffff;border:1px solid rgba(15,23,42,0.06);max-width:70%;box-shadow:0 6px 18px rgba(15,23,42,0.06);font-size:20px;line-height:1.4;text-align:center;color:#0f1720}
.bubble.bot{background:#f8fafc}
.bubble.user{background:linear-gradient(180deg,#dbeafe,#bfdbfe)}
.meta{font-size:12px;color:var(--muted);margin-bottom:6px}

/* Ensure messages are centered and large as requested */
.messages .msg{width:100%;display:flex;justify-content:center}
.messages .msg.user{justify-content:center}

.bubble .content{white-space:pre-wrap}

.composer{display:flex;gap:12px;padding:14px;border-top:1px solid rgba(255,255,255,0.03);align-items:center}
.composer textarea{flex:1;resize:none;padding:12px;border-radius:8px;border:1px solid rgba(255,255,255,0.04);background:transparent;color:inherit;font-size:15px;min-height:44px;max-height:220px}
.send{background:var(--accent);color:white;padding:10px 14px;border-radius:8px;border:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}
.send svg{filter:drop-shadow(0 1px 0 rgba(0,0,0,0.2));}
.icon-btn{background:transparent;border:1px solid rgba(255,255,255,0.03);padding:8px;border-radius:8px;color:var(--muted);cursor:pointer}

.composer textarea:focus{outline:none;box-shadow:0 0 0 3px rgba(16,163,127,0.08);border-color:rgba(16,163,127,0.6)}

@media (prefers-color-scheme: light){
  /* keep it dark by default to match ChatGPT's dark theme */
}

@media (max-width:900px){
  .sidebar{display:none}
  .messages{max-width:100%}
}

/* Mobile-specific adjustments */
@media (max-width:600px){
  /* let main use full width on small devices */
  .main{margin-right:0}

  /* language menu small and slightly lower */
  .lang-menu{right:10px;top:8px;width:auto;padding:6px;background:transparent}
  .lang-menu .menu-top{flex-direction:row;gap:6px}
  .lang-menu h3{display:none}
  .lang-btn{padding:6px 6px;font-size:11px}

  /* narrower messages area and readable font sizes */
  .messages{gap:14px;padding:8px;max-width:100%;align-items:flex-start}
  .bubble{font-size:16px;max-width:86%;text-align:left;padding:12px 14px}
  .meta{font-size:11px;margin-bottom:6px}

  /* composer becomes full-width pill with smaller padding */
  .composer{width:calc(100% - 24px);left:50%;transform:translateX(-50%);bottom:18px;padding:8px 10px}
  .composer input{font-size:14px;padding:8px}
  .composer .composer-left{display:none}
  .composer .composer-right .send{padding:8px}

  /* composer scroll (down arrow) slightly above composer */
  .composer-scroll-wrap{bottom:84px}

  /* hero form full width */
  .hero-form{width:100%;max-width:100%;padding:10px}
  .hero h2{font-size:clamp(18px,4.5vw,24px)}

  /* ensure message alignment is vertical stack on mobile */
  .messages .msg{flex-direction:column;align-items:flex-start}
  .messages .msg.user{align-items:flex-end}
}
