:root {
  color-scheme: light;
}
* {
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  max-width: 1080px;
  margin: 24px auto 48px;
  padding: 0 16px;
  color: #1f2933;
}
body.auth-page {
  max-width: 640px;
}
.auth-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  margin-top: 32px;
}
.auth-card h2 {
  margin: 0 0 12px;
  font-size: 20px;
}
.auth-card p {
  margin: 0 0 16px;
  color: #475569;
  font-size: 14px;
}
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
h1 {
  margin: 0;
  font-size: 24px;
}
.user-name {
  font-size: 14px;
  color: #0f172a;
}
form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  font-size: 15px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  resize: vertical;
}
button {
  align-self: flex-start;
  padding: 10px 16px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  background: #0f766e;
  color: #fff;
  cursor: pointer;
}
.secondary {
  background: #e2e8f0;
  color: #0f172a;
}
.secondary:hover {
  background: #cbd5e1;
}
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.layout {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 16px;
  align-items: start;
}
.main {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  min-height: 200px;
  background: #f8fafc;
}
.main img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
}
.main .prompt-text {
  margin-top: 8px;
  font-size: 14px;
  color: #475569;
  white-space: pre-wrap;
}
.main .timestamp {
  padding: 6px 0;
  font-size: 12px;
  color: #6b7280;
}
.main-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.ghost {
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}
.ghost:hover {
  background: #fee2e2;
}
.placeholder {
  color: #6b7280;
  font-size: 14px;
  padding: 24px;
  text-align: center;
}
.status {
  font-size: 14px;
  color: #0f172a;
  min-height: 20px;
}
.model-info {
  font-size: 12px;
  color: #4b5563;
  margin-bottom: 12px;
}
.status.error {
  color: #b91c1c;
}
.history-panel {
  position: sticky;
  top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 520px;
}
.history-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.thumbs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
}
.thumb {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.thumb img {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.thumb .meta {
  font-size: 11px;
  color: #6b7280;
}
@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .history-panel {
    position: static;
    max-height: none;
  }
  .thumbs {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
  }
  .thumb {
    width: calc(50% - 8px);
  }
}
