:root {
  --red-base: #b83232;
  --red-light: #e04c4c;
  --red-dark: #720f0f;
  --red-glow: #ff3a3a;
  --background-dark: #0b0000;
  --background-light: #fef5f5;
  --text-color: #ffffff;
  --border-color: #5a1c1c;
  --shadow-soft: rgba(184, 50, 50, 0.3);
  --user-msg-bg-dark: #4f0000;
  --user-msg-bg-light: #ffdada;
  --bot-msg-bg-dark: #3b0000;
  --bot-msg-bg-light: #f9ecec;
  --input-bg-dark: #330000;
  --input-bg-light: #ffefef;
  --input-text-dark: #ffffff;
  --input-text-light: #6a0a0a;
  --border-light: #cc7a7a;
  --panel-bg-dark: rgba(15, 0, 0, 0.85);
  --panel-bg-light: rgba(255, 245, 245, 0.95);
  --tech-grid: rgba(184, 50, 50, 0.05);
  --header-height: 80px;
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body, html {
  height: 100%;
  font-family: 'Inter', sans-serif;
  color: #ffffff;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--background-dark);
  transition: background 0.3s ease, color 0.3s ease;
  perspective: 1000px;
}
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  position: relative;
  overflow: hidden;
}

body[data-theme="dark"] {
  background: var(--background-dark);
  color: var(--text-color);
}
body[data-theme="light"] {
  background: var(--background-light);
  color: #440000;
}

/* Gaming Background Effects */
.tech-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.grid-lines {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--tech-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--tech-grid) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.3;
}

.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(184, 50, 50, 0.3);
  box-shadow: 0 0 20px 8px rgba(255, 0, 0, 0.7);
  z-index: 2;
  animation: scan 4s linear infinite;
  pointer-events: none;
}

@keyframes scan {
  0% { top: 0; }
  100% { top: 100%; }
}

/* Modal overlay */
#welcomeModal {
  position: fixed;
  inset: 0;
  background: rgba(15,0,0,0.95);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 1000;
  user-select: text;
}

#welcomeContent {
  background: var(--user-msg-bg-dark);
  border-radius: 16px;
  padding: 2rem;
  max-width: 90%;
  width: 480px;
  box-shadow: inset 0 0 25px var(--red-dark), 0 0 30px rgba(255, 0, 0, 0.4);
  text-align: center;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.3s ease;
}

#welcomeContent::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,0,0,0.1) 0%, transparent 70%);
  z-index: 0;
}

#welcomeContent > * {
  position: relative;
  z-index: 1;
}

#welcomeContent h1 {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px var(--red-glow), 0 0 20px var(--red-glow);
}

#welcomeContent p {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 1.2rem;
  color: var(--red-light);
  font-weight: 500;
}

#welcomeContent ul {
  text-align: left;
  margin-bottom: 1.5rem;
  list-style: inside disc;
  color: var(--red-light);
  font-weight: 600;
  padding: 0 1rem;
}

#startChatBtn {
  background: linear-gradient(135deg, var(--red-base), var(--red-dark));
  border: none;
  padding: 0.9rem 2.2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 0 15px var(--red-base);
  transition: all 0.25s ease;
  user-select: none;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  z-index: 1;
  margin-bottom: 1.2rem;
}
#startChatBtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
  z-index: -1;
}
#startChatBtn:hover::before {
  left: 100%;
}
#startChatBtn:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px var(--red-light);
  transform: scale(1.05);
}

/* Social icons */
.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(184, 50, 50, 0.2);
  color: var(--red-light);
  font-size: 1.3rem;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(184, 50, 50, 0.3);
}

.social-icon:hover {
  background: rgba(184, 50, 50, 0.4);
  transform: translateY(-5px) scale(1.1);
  color: white;
  box-shadow: 0 0 20px var(--red-base);
}

/* Chat area */
#chatApp {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg-dark);
  padding: 1rem;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  border-top: 2px solid var(--red-base);
  border-radius: 0 0 20px 20px;
  user-select: text;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(4px);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5), 0 0 30px rgba(184, 50, 50, 0.3);
}
#chatApp.active {
  opacity: 1;
  pointer-events: auto;
}

body[data-theme="light"] #chatApp {
  background: var(--panel-bg-light);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.1), 0 0 30px rgba(184, 50, 50, 0.2);
}

header {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--red-base);
  text-align: center;
  margin-bottom: 0.8rem;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  text-shadow: 0 0 8px var(--red-glow);
  position: sticky;
  top: 0;
  background: var(--panel-bg-dark);
  z-index: 100;
  transition: transform 0.3s ease;
  border-bottom: 1px solid var(--red-base);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

body[data-theme="light"] header {
  background: var(--panel-bg-light);
}

header.hidden {
  transform: translateY(-100%);
}

header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--red-base), transparent);
  box-shadow: 0 0 10px var(--red-base);
}

/* Header buttons container */
.header-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
  align-items: center;
}

/* Chat container */
.chat-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.8rem 4px 0.8rem 0;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--red-base) transparent;
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: #ffffff;
  user-select: text;
}
.chat-container::-webkit-scrollbar {
  width: 6px;
}
.chat-container::-webkit-scrollbar-thumb {
  background: var(--red-base);
  border-radius: 12px;
  box-shadow: inset 0 0 4px var(--red-dark);
}
.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

/* Message bubble styling */
.message {
  max-width: 92%;
  padding: 1rem;
  border-radius: 16px;
  word-wrap: break-word;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: default;
  background-color: var(--bot-msg-bg-dark);
  border: 1.5px solid var(--border-color);
  box-shadow: 0 1px 6px var(--shadow-soft);
  white-space: pre-wrap;
  color: #ffffff;
  transform-origin: center bottom;
  will-change: transform, box-shadow;
  animation: messageAppear 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
}

.message:hover {
  transform: translateY(-5px) scale(1.02);
  z-index: 10;
  box-shadow: 0 8px 20px rgba(184, 50, 50, 0.4);
}

.message.user {
  background-color: var(--user-msg-bg-dark);
  align-self: flex-end;
  border-color: var(--red-light);
  box-shadow: 0 1px 6px var(--shadow-soft), 0 0 10px rgba(184, 50, 50, 0.3);
}

.message.user:hover {
  box-shadow: 0 8px 20px rgba(184, 50, 50, 0.5);
}

.message.bot {
  background-color: var(--bot-msg-bg-dark);
  align-self: flex-start;
  border-color: #af4f4f;
  box-shadow: 0 1px 6px var(--shadow-soft), 0 0 10px rgba(184, 50, 50, 0.2);
}

.message.bot:hover {
  box-shadow: 0 8px 20px rgba(184, 50, 50, 0.3);
}

@keyframes messageAppear {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Math content styling */
.math-content {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 1rem;
  margin: 0.7rem 0;
  border: 1px solid var(--border-color);
}

body[data-theme="light"] .math-content {
  background: rgba(255, 255, 255, 0.2);
}

.math-title {
  font-weight: bold;
  color: var(--red-light);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 1rem;
}

.math-step {
  margin: 0.6rem 0;
  padding-left: 1rem;
  position: relative;
}

.math-step:before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--red-light);
}

.math-formula {
  font-size: 1.1rem;
  text-align: center;
  margin: 0.9rem 0;
  padding: 0.7rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
}

body[data-theme="light"] .math-formula {
  background: rgba(255, 255, 255, 0.3);
}

.final-answer {
  background: rgba(184, 50, 50, 0.2);
  border: 2px solid var(--red-base);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1rem;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
  box-shadow: 0 0 15px rgba(184, 50, 50, 0.3);
}

.math-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.9rem 0;
  background: rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .math-table {
  background: rgba(255, 255, 255, 0.15);
}

.math-table th {
  background: rgba(184, 50, 50, 0.3);
  padding: 0.5rem;
  text-align: left;
  border: 1px solid var(--border-color);
}

.math-table td {
  padding: 0.5rem;
  border: 1px solid var(--border-color);
}

.math-table tr:nth-child(even) {
  background: rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .math-table tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.1);
}

/* Code block styling */
pre {
  position: relative;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  margin: 0.9rem 0;
  border: 1px solid var(--border-color);
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}

body[data-theme="light"] pre {
  background: rgba(255, 245, 245, 0.9);
  color: #4a0000;
}

.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(184, 50, 50, 0.3);
  border: 1px solid var(--border-color);
  color: var(--red-light);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s ease;
  opacity: 0;
  transform: translateY(-5px);
}

pre:hover .copy-btn {
  opacity: 1;
  transform: translateY(0);
}

.copy-btn:hover {
  background: rgba(184, 50, 50, 0.5);
  color: white;
}

.copy-success {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(50, 184, 50, 0.7);
  color: white;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.7rem;
  animation: fadeOut 1.5s forwards;
}

@keyframes fadeOut {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* Fixed inline code formatting */
code {
  font-family: 'Courier New', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

body[data-theme="light"] code {
  background: rgba(255, 245, 245, 0.9);
  color: #4a0000;
}

/* Loading / typing indicator */
.loading {
  font-style: italic;
  color: var(--red-light);
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  user-select: none;
  letter-spacing: 0.05em;
  white-space: nowrap;
  opacity: 1;
  transform: translateY(0);
  margin: 0.5rem 0;
}
.loading-dots span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 4px;
  background: var(--red-base);
  border-radius: 50%;
  animation-name: blink;
  animation-duration: 1.3s;
  animation-iteration-count: infinite;
  animation-timing-function: ease-in-out;
}
.loading-dots span:nth-child(1) {
  animation-delay: 0;
}
.loading-dots span:nth-child(2) {
  animation-delay: 0.25s;
}
.loading-dots span:nth-child(3) {
  animation-delay: 0.5s;
  margin-right: 0;
}
@keyframes blink {
  0%, 80%, 100% {
    opacity: 0.3;
  }
  40% {
    opacity: 1;
  }
}

/* Input area */
.input-area {
  display: flex;
  padding: 1rem;
  background: var(--input-bg-dark);
  border-top: 1.5px solid var(--red-base);
  align-items: center;
  user-select: none;
  border-radius: 0 0 20px 20px;
  position: relative;
  z-index: 10;
  flex-wrap: wrap;
}
body[data-theme="light"] .input-area {
  background: var(--input-bg-light);
  border-color: var(--border-light);
}
.input-area input {
  flex: 1;
  padding: 0.8rem 1.2rem;
  font-size: 1rem;
  border-radius: 50px;
  border: 1.5px solid var(--border-color);
  outline: none;
  background: var(--input-bg-dark);
  color: var(--input-text-dark);
  box-shadow: inset 0 0 10px var(--red-dark);
  transition: box-shadow 0.3s ease, background 0.3s ease, color 0.3s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.03em;
  user-select: text;
  caret-color: var(--red-base);
  min-width: 0;
}
body[data-theme="light"] .input-area input {
  background: var(--input-bg-light);
  color: var(--input-text-light);
  border-color: var(--border-light);
  box-shadow: inset 0 0 10px rgba(184, 50, 50, 0.2);
}
.input-area input:focus {
  box-shadow: 0 0 16px var(--red-base);
  color: #fff;
  background: var(--input-bg-dark);
}
body[data-theme="light"] .input-area input:focus {
  background: var(--input-bg-light);
  color: var(--input-text-light);
  box-shadow: 0 0 16px rgba(184, 50, 50, 0.4);
}
.input-area button {
  margin-left: 0.7rem;
  background: linear-gradient(135deg, var(--red-base), var(--red-dark));
  border: none;
  border-radius: 50px;
  padding: 0.8rem 1.6rem;
  color: #f5dada;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 0 15px var(--red-base);
  transition: all 0.3s ease;
  user-select: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: 'Orbitron', sans-serif;
  position: relative;
  overflow: hidden;
  min-width: 90px;
}
.input-area button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}
.input-area button:hover::before {
  left: 100%;
}
.input-area button:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 25px var(--red-base);
  transform: scale(1.05);
}

/* Mic button */
.mic-btn {
  margin-left: 0.7rem;
  background: var(--red-base);
  border-radius: 50%;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--red-base);
  transition: all 0.3s ease;
  user-select: none;
  filter: drop-shadow(0 0 3px var(--red-base));
  position: relative;
  overflow: hidden;
}
.mic-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}
.mic-btn:hover::before {
  left: 100%;
}
.mic-btn:hover {
  filter: brightness(1.2) drop-shadow(0 0 6px var(--red-base));
  transform: scale(1.1);
}
.mic-btn.active {
  animation: pulse 1.4s infinite;
  box-shadow: 0 0 20px var(--red-base);
  filter: drop-shadow(0 0 10px var(--red-base));
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 20px var(--red-base); }
  50% { box-shadow: 0 0 28px var(--red-base); }
}

/* Listening indicator */
.listening-indicator {
  position: absolute;
  top: -35px;
  right: 10px;
  background: rgba(184, 50, 50, 0.8);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeInOut 1.5s infinite;
  z-index: 20;
}

.listening-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3a3a;
  animation: pulse 1s infinite;
}

@keyframes fadeInOut {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}


 /* Export button */
#exportBtn, .toggle-theme {
  background: linear-gradient(135deg, #7a1b1b, #b83232);
  border: none;
  border-radius: 30px;
  padding: 0.5rem 1rem;
  font-weight: 600;
  color: #f4d4d4;
  cursor: pointer;
  box-shadow: 0 0 10px var(--red-base);
  transition: all 0.3s ease;
  user-select: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
}

#exportBtn::before, .toggle-theme::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

#exportBtn:hover::before, .toggle-theme:hover::before {
  left: 100%;
}

#exportBtn:hover, .toggle-theme:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 18px var(--red-base);
  transform: scale(1.08);
}

/* Toggle theme button */
.toggle-theme {
  min-width: 110px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.toggle-theme i {
  font-size: 1rem;
}

/* Footer with credit */
footer {
  background: var(--user-msg-bg-dark);
  text-align: center;
  padding: 0.6rem 0;
  font-size: 0.8rem;
  color: #8b2929;
  user-select: none;
  border-top: 1.5px solid var(--border-color);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(2px);
}

body[data-theme="light"] footer {
  background: var(--user-msg-bg-light);
  color: #b83232;
}

footer a {
  color: var(--red-base);
  font-weight: 600;
  text-decoration: none;
  user-select: text;
  transition: color 0.3s ease;
}
footer a:hover {
  color: var(--red-light);
  text-decoration: underline;
  filter: drop-shadow(0 0 5px var(--red-light));
}

/* Quick questions in chat */
.chat-quick-questions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 0.7rem;
  width: 100%;
}

.chat-quick-btn {
  display: block;
  background: rgba(184, 50, 50, 0.2);
  border: 1px solid var(--red-base);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  color: var(--red-light);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
  font-family: 'Inter', sans-serif;
  position: relative;
  overflow: hidden;
}

.chat-quick-btn:hover {
  background: rgba(184, 50, 50, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 0 10px rgba(184, 50, 50, 0.4);
}

.chat-quick-btn::after {
  content: '→';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: bold;
  color: var(--red-light);
  transition: transform 0.3s ease;
}

.chat-quick-btn:hover::after {
  transform: translateY(-50%) translateX(3px);
}

/* Mobile-specific fixes */
@media (max-width: 600px) {
  #welcomeContent {
    padding: 1.5rem;
  }
  
  #welcomeContent h1 {
    font-size: 1.8rem;
  }
  
  #welcomeContent p {
    font-size: 0.95rem;
  }
  
  #startChatBtn {
    padding: 0.8rem 1.8rem;
    font-size: 1rem;
  }
  
  .social-icons {
    gap: 1rem;
  }
  
  .social-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }
  
  header {
    padding: 0.6rem 0.5rem;
  }
  
  .header-buttons {
    gap: 0.6rem;
  }
  
  #exportBtn, .toggle-theme {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: 90px;
  }
  
  .input-area {
    padding: 0.8rem;
  }
  
  .input-area input {
    padding: 0.7rem 1.1rem;
    font-size: 0.95rem;
  }
  
  .input-area button {
    padding: 0.7rem 1.4rem;
    font-size: 0.95rem;
    min-width: 80px;
  }
  
  .mic-btn {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
  
  .message {
    padding: 0.9rem;
    font-size: 0.95rem;
  }
  
  .chat-quick-btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }
  
  .listening-indicator {
    top: -32px;
    right: 8px;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
  }
}

/* Tablet landscape fixes */
@media (min-width: 601px) and (max-width: 1024px) and (orientation: landscape) {
  #app {
    min-height: 100vh;
    height: auto;
  }
  
  #welcomeContent {
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .input-area {
    position: sticky;
    bottom: 0;
  }
}

/* Prevent zoom on input focus */
input, select, textarea {
  font-size: 16px;
}

/* Touch area improvements */
button, .chat-quick-btn, .mic-btn, .social-icon {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Prevent text overflow */
.message {
  overflow-wrap: break-word;
  hyphens: auto;
}