* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #f0f0f0;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

header {
  padding: 16px;
  border-bottom: 1px solid #222;
  position: sticky;
  top: 0;
  background: #0a0a0a;
  z-index: 10;
}
header h1 {
  font-size: 18px;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

#today-summary {
  font-size: 13px;
  color: #888;
  line-height: 1.4;
  min-height: 18px;
}

main {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.message {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
  white-space: pre-wrap;
  line-height: 1.5;
  word-wrap: break-word;
}

.message.user {
  background: #1a3a5c;
  margin-left: auto;
}

.message.assistant {
  background: #1a1a1a;
}

.message.system {
  background: #2a1414;
  color: #ffaaaa;
  font-size: 13px;
}

.message .role {
  font-size: 11px;
  opacity: 0.6;
  margin-bottom: 4px;
}

footer {
  padding: 16px;
  border-top: 1px solid #222;
  background: #0a0a0a;
  position: sticky;
  bottom: 0;
}

.big-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 80px;
  border: none;
  border-radius: 12px;
  background: #d44;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.big-btn:active { transform: scale(0.97); }
.big-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.big-btn.recording {
  background: #f55;
  animation: pulse 1s infinite;
}

.big-btn.processing {
  background: #555;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 85, 85, 0.4); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 85, 85, 0); }
}

.mic-icon { font-size: 28px; }

details {
  margin-top: 12px;
  font-size: 13px;
  color: #888;
}
details summary { cursor: pointer; padding: 4px 0; }

#text-form { display: flex; gap: 8px; margin-top: 8px; }

#text-input {
  flex: 1;
  padding: 10px 12px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  color: white;
  /* iOS Safari zooms inputs <16px on focus — keep at 16px to prevent zoom. */
  font-size: 16px;
}

#text-form button {
  padding: 10px 16px;
  background: #444;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
}
#text-form button:disabled { opacity: 0.5; cursor: not-allowed; }
