/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
html, body {
  height: 100%;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #000;
  -webkit-font-smoothing: antialiased;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Initial centered state — prompt in the middle of the screen */
#app.centered {
  justify-content: center;
}

#app.centered #conversation {
  flex: 0 0 auto;
  overflow: visible;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 12px 0;
}

#app.centered .message-text.agent {
  border-left: none;
  padding-left: 0;
}

#app.centered .message-label {
  display: none;
}

#app.centered #prompt-bar {
  border-top: none;
}

/* Larger branding in centered state */
#app.centered #header {
  margin-bottom: 16px;
}

#app.centered #logo {
  width: 96px;
  height: 96px;
}

#app.centered #brand-name {
  font-size: 16px;
  letter-spacing: 5px;
  margin-top: 12px;
}

#app.centered #tagline {
  font-size: 12px;
  margin-top: 6px;
}

/* Header */
#header {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 12px;
  flex-shrink: 0;
}

#logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  filter: grayscale(100%);
}

#brand-name {
  font-size: 12px;
  letter-spacing: 3px;
  font-weight: 600;
  margin-top: 8px;
}

#tagline {
  font-size: 10px;
  color: #999;
  margin-top: 3px;
}

#lang-toggle {
  position: absolute;
  top: 28px;
  right: 0;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  font-weight: 600;
  background: none;
  border: 1px solid #ddd;
  color: #999;
  padding: 3px 8px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

#lang-toggle:hover {
  color: #000;
  border-color: #000;
}

/* Conversation */
#conversation {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 0;
  gap: 16px;
}

.message-group {
  display: flex;
  flex-direction: column;
}

.message-label {
  font-family: 'Courier New', monospace;
  font-size: 10px;
  color: #999;
  margin-bottom: 3px;
}

.message-text {
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message-text.agent {
  padding-left: 12px;
  border-left: 2px solid #000;
}

.message-text.error {
  color: #999;
  font-size: 12px;
  padding-left: 12px;
  border-left: 2px solid #eee;
}

/* Blinking cursor */
.cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: #000;
  vertical-align: middle;
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Prompt bar */
#prompt-bar {
  display: flex;
  align-items: center;
  border-top: 1px solid #eee;
  padding: 14px 0;
  flex-shrink: 0;
  gap: 8px;
}

#prompt-indicator {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  color: #000;
  flex-shrink: 0;
}

#prompt-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  resize: none;
  line-height: 1.5;
  max-height: 120px;
  color: #000;
  background: transparent;
}

#prompt-input::placeholder {
  color: #bbb;
}

#send-btn {
  display: none;
  border: none;
  background: none;
  font-size: 18px;
  color: #000;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}

/* Mobile */
@media (max-width: 640px) {
  #logo {
    width: 36px;
    height: 36px;
  }

  #header {
    padding: 18px 0 8px;
  }

  #brand-name {
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 6px;
  }

  #tagline {
    font-size: 9px;
    margin-top: 2px;
  }

  .message-label {
    font-size: 9px;
  }

  .message-text {
    font-size: 12px;
  }

  .message-text.agent {
    padding-left: 10px;
  }

  #prompt-input {
    font-size: 16px; /* Prevent iOS zoom on focus */
  }

  #send-btn {
    display: block;
  }
}
