body {
  margin: 0;
  background: #0E1E32;
  color: #E8F4FD;
  font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
}

* {
  box-sizing: border-box;
}

button,
textarea,
select {
  font: inherit;
}

#content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 96px auto 96px;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 0 16px;
  background: rgba(16, 36, 58, 0.97);
  border-bottom: 1px solid #284764;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 100%;
}

.header-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: none;
  border: 0;
  background: transparent;
  display: block;
}

.header-title {
  justify-self: center;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-button,
.send-button {
  border: 0;
  border-radius: 10px;
  background: #A0E9C5;
  color: #092A20;
  cursor: pointer;
}

.header-button {
  justify-self: end;
  padding: 10px 14px;
}

#chat-log-container {
  flex: 1;
  width: min(900px, 100%);
  margin: 0 auto;
  padding: 24px 16px;
}

#chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message-row {
  display: flex;
  scroll-margin-bottom: 180px;
}

.message-row[hidden] {
  display: none;
}

.message-row.user {
  justify-content: flex-end;
}

.message-row.assistant {
  justify-content: flex-start;
}

.message {
  max-width: min(80%, 680px);
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.55;
  word-break: break-word;
}

.message.user {
  background: #A0E9C5;
  color: #092A20;
  white-space: pre-wrap;
}

.message.assistant {
  background: #193A5D;
  border: 1px solid #365B7A;
  color: #E8F4FD;
}

.assistant-reply {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  max-width: min(80%, 680px);
  margin: 0;
}

.assistant-reply .message {
  max-width: 100%;
}

.response-model {
  margin: 4px 2px 0 0;
  color: #A0B8CB;
  font-size: 0.75rem;
  text-align: right;
  overflow-wrap: anywhere;
}

.message.thinking-indicator {
  color: #A0B8CB;
  background: transparent;
  border-color: #284764;
  padding: 8px 12px;
  font-size: 0.9rem;
}

.thinking-indicator summary {
  cursor: pointer;
}

.thinking-text {
  margin-top: 8px;
  max-height: min(16rem, 35vh);
  overflow: auto;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

#footer {
  position: sticky;
  bottom: 0;
  padding: 12px 14px max(18px, env(safe-area-inset-bottom));
  background: rgba(16, 36, 58, 0.97);
  border-top: 1px solid #284764;
}

#composer {
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  background: #0E1E32;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #3E6280;
}

#input-prompt {
  width: 100%;
  resize: none;
  background: transparent;
  border: 0;
  color: #E8F4FD;
  outline: none;
  font-size: 1rem;
  padding: 8px 6px;
}

#input-prompt::placeholder {
  color: #A0B8CB;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer-selectors {
  display: flex;
  min-width: 0;
  gap: 8px;
}

.composer-selectors select {
  min-width: 0;
  max-width: 100%;
  color: #E8F4FD;
  background: #193A5D;
  border: 1px solid #365B7A;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.9rem;
}

button:disabled,
.composer-selectors select:disabled {
  opacity: 0.65;
  cursor: default;
}

.send-button {
  padding: 10px 16px;
  min-width: 92px;
}

@media (max-width: 640px) {
  .composer-toolbar,
  .composer-selectors {
    gap: 6px;
  }

  .composer-selectors select {
    padding-inline: 6px;
  }

  .send-button {
    min-width: 0;
    padding-inline: 12px;
  }

  .header-title {
    font-size: 0.96rem;
  }

  .header-logo {
    width: 36px;
    height: 36px;
  }

  .message,
  .assistant-reply {
    max-width: 88%;
    font-size: 0.98rem;
  }

  #header {
    padding: 0 10px;
  }
}

a {
  color: #7EE7B3;
}

a:hover {
  color: #C2F6DA;
}

.message.user a {
  color: #12543C;
}

button:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 2px solid #DDF9EB;
  outline-offset: 3px;
}

#composer:focus-within {
  border-color: #7EE7B3;
}
