* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f0f4f8;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Header */
header {
  background: linear-gradient(135deg, #0077b6, #00b4d8);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-logo {
  font-size: 36px;
}

.header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.store-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.store-sub {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 2px;
}

.reset-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.5);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.reset-btn:active { background: rgba(255,255,255,0.35); }

/* Chat messages */
#chatBox {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  -webkit-overflow-scrolling: touch;
}

.bubble {
  display: flex;
  max-width: 85%;
}

.bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bubble.assistant {
  align-self: flex-start;
}

.bubble-text {
  padding: 14px 18px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.55;
  word-break: break-word;
}

.bubble.user .bubble-text {
  background: #0077b6;
  color: white;
  border-bottom-right-radius: 6px;
}

.bubble.assistant .bubble-text {
  background: white;
  color: #1a1a2e;
  border-bottom-left-radius: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.bubble.typing .bubble-text {
  color: #888;
  font-style: italic;
}

/* Quick buttons */
#quickBtns {
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none;
}
#quickBtns::-webkit-scrollbar { display: none; }

.quick-btn {
  background: white;
  border: 1.5px solid #00b4d8;
  color: #0077b6;
  padding: 10px 16px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.quick-btn:active {
  background: #e0f7fa;
  transform: scale(0.97);
}

/* Input area */
#inputArea {
  padding: 12px 16px 20px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: white;
  border-top: 1px solid #e0e0e0;
  flex-shrink: 0;
}

#msgInput {
  flex: 1;
  border: 1.5px solid #ccc;
  border-radius: 24px;
  padding: 12px 18px;
  font-size: 16px;
  resize: none;
  outline: none;
  line-height: 1.4;
  max-height: 120px;
  overflow-y: auto;
  font-family: inherit;
  transition: border-color 0.2s;
}
#msgInput:focus { border-color: #00b4d8; }

#sendBtn {
  background: #0077b6;
  color: white;
  border: none;
  border-radius: 24px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}
#sendBtn:active { background: #005f8e; }
#sendBtn:disabled {
  background: #b0c4d8;
  cursor: not-allowed;
}
