:root{
  --bg:#0f1720;
  --card:#0b1220;
  --accent:#ffb86b;
  --muted:#9aa4b2;
  --glass: rgba(255,255,255,0.03);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background:linear-gradient(180deg,#07101a 0%, var(--bg) 100%);
  color:#e6eef6;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  min-height:100vh;
}

.app{
  width:100%;
  max-width:760px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:14px;
  padding:18px;
  box-shadow: 0 8px 30px rgba(2,6,23,0.6);
  display:flex;
  flex-direction:column;
  gap:12px;
  align-items:stretch;
}

/* header */
.brand{
  display:flex;
  gap:12px;
  align-items:center;
}
.brand .logo{
  width:48px;
  height:48px;
  border-radius:10px;
  background:linear-gradient(135deg, #ffb86b, #ff6b6b);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:#082028;
  box-shadow:0 6px 18px rgba(255,107,107,0.12), inset 0 -6px 18px rgba(0,0,0,0.12);
  font-size:20px;
}
.brand h1{
  margin:0;
  font-size:18px;
  letter-spacing:0.2px;
}

/* form */
.search{
  display:flex;
  gap:12px;
  align-items:center;
  width:100%;
}
.search input[type="search"]{
  flex:1;
  min-height:52px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.04);
  background:var(--glass);
  color:inherit;
  padding:12px 14px;
  font-size:16px;
  outline:none;
  transition:box-shadow .12s, border-color .12s;
}
.search input[type="search"]:focus{
  box-shadow:0 6px 20px rgba(0,0,0,0.6), 0 0 0 4px rgba(255,184,107,0.06);
  border-color: rgba(255,184,107,0.35);
}

.actions{
  display:flex;
  gap:8px;
}

button{
  -webkit-appearance:none;
  appearance:none;
  border:0;
  background:linear-gradient(180deg,var(--accent), #ff9a3f);
  color:#082028;
  padding:12px 14px;
  border-radius:10px;
  font-weight:600;
  min-width:56px;
  min-height:52px;
  cursor:pointer;
  box-shadow:0 8px 18px rgba(10,10,10,0.4);
}
button[type="button"]{
  background:transparent;
  color:var(--muted);
  border:1px solid rgba(255,255,255,0.03);
  padding:10px 12px;
  min-width:48px;
  min-height:48px;
}

.hint{
  margin:0;
  color:var(--muted);
  font-size:13px;
}

/* accessibility */
.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;
}

/* Responsive: keep everything fitting one screen height on mobile */
@media (max-height:700px){
  body{padding:12px}
  .app{padding:12px}
  .brand h1{font-size:16px}
  .search input[type="search"]{min-height:48px}
  button{min-height:48px;padding:10px 12px}
}

/* Chat modal styles */
.chat-modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:flex-end;
  justify-content:center;
  background:rgba(2,6,12,0.45);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
  z-index:40;
}
.chat-modal.open{
  opacity:1;
  pointer-events:auto;
}
.chat-sheet{
  width:100%;
  max-width:760px;
  background:linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:14px 14px 0 0;
  margin:0 12px 12px;
  box-shadow: 0 12px 40px rgba(2,6,23,0.6);
  display:flex;
  flex-direction:column;
  max-height:78vh;
  overflow:hidden;
}
.chat-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid rgba(255,255,255,0.03);
  font-weight:600;
  color:var(--muted);
}
.chat-messages{
  padding:12px;
  overflow:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  background:transparent;
}
.msg{
  max-width:92%;
  padding:10px 12px;
  border-radius:10px;
  font-size:14px;
  line-height:1.35;
}
.msg.user{
  align-self:flex-end;
  background:linear-gradient(180deg,#0b2b2b,#052427);
  color:#e6f7f2;
}
.msg.ai{
  align-self:flex-start;
  background:rgba(255,255,255,0.03);
  color:var(--muted);
}
.chat-input{
  display:flex;
  gap:8px;
  padding:10px;
  border-top:1px solid rgba(255,255,255,0.02);
  background:linear-gradient(180deg, rgba(255,255,255,0.01), rgba(255,255,255,0.01));
}
.chat-input input{
  flex:1;
  min-height:44px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.03);
  padding:10px 12px;
  background:var(--glass);
  color:inherit;
  outline:none;
}
.chat-input button{
  min-width:64px;
  padding:10px 12px;
  border-radius:10px;
}