* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #0f1115;
  color: #e7e9ee;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 80px;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

h1 {
  font-size: 20px;
  margin: 0;
}

.hidden { display: none !important; }

form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #a9adb8;
}

input, textarea {
  background: #1a1d24;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  color: #e7e9ee;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
}

textarea {
  min-height: 80px;
  resize: vertical;
}

button {
  background: #4f7cff;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: default; }

button.ghost {
  background: transparent;
  border: 1px solid #2b2f3a;
  color: #a9adb8;
}

.error {
  color: #ff6b6b;
  font-size: 14px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.msg {
  padding: 10px 14px;
  border-radius: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg.user {
  background: #4f7cff22;
  align-self: flex-end;
}

.msg.assistant {
  background: #1a1d24;
  border: 1px solid #2b2f3a;
}

.model-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.model-selector legend {
  padding: 0 4px;
  color: #a9adb8;
  font-size: 13px;
}

.model-option {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  width: auto;
  font-size: 14px;
  color: #e7e9ee;
}

.compare-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.compare-row.single {
  grid-template-columns: 1fr;
}

.model-card {
  background: #1a1d24;
  border: 1px solid #2b2f3a;
  border-radius: 10px;
  padding: 10px 14px;
}

.model-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #4f7cff;
  margin-bottom: 6px;
}

.model-card-body {
  line-height: 1.5;
  white-space: pre-wrap;
}

.model-card-metrics {
  margin-top: 8px;
  font-size: 12px;
  color: #a9adb8;
}

.doc-panel {
  border: 1px solid #2b2f3a;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}

.doc-upload-label {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: #a9adb8;
}

#doc-active {
  display: flex;
  align-items: center;
  gap: 10px;
}

#doc-active-name {
  color: #e7e9ee;
}

.hint {
  color: #a9adb8;
  font-size: 13px;
  margin: 6px 0 0;
}

.model-option.disabled {
  opacity: 0.4;
}
