body {
  background: #000;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
  margin: 0;
  font-size: 19px;
}

.header {
  padding: 20px 10px 16px 10px;
  border-bottom: 1px solid #111;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  flex: 1;
  text-align: left;
}

.header-right {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.subtitle {
  font-size: 13px;
  color: #888;
  margin-top: 2px;
  letter-spacing: 1px;
}

.header-btn {
  background: #111;
  border: 1px solid #555;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.header-btn:hover {
  background: #1a1a1a;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.user-email {
  font-size: 13px;
  color: #888;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Chat layout ── */

.chat-container {
  max-width: 820px;
  margin: auto;
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
}

.chat-container.center {
  justify-content: center;
  align-items: center;
}

.chat-container.bottom {
  justify-content: flex-end;
}

#chat {
  flex: 1;
  overflow-y: auto;
  padding: 40px 24px 20px 24px;
  width: 100%;
  box-sizing: border-box;
}

.chat-container.center #chat {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.message {
  margin: 12px 0;
  font-size: 19px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.options {
  display: flex;
  gap: 14px;
  padding: 16px 24px;
  flex-wrap: wrap;
}

.options button {
  background: #111;
  border: 1px solid #555;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.2s;
}

.options button:hover {
  background: #1a1a1a;
}

.input-area {
  padding: 18px 20px;
  background: #000;
  width: 100%;
  box-sizing: border-box;
}

textarea {
  width: 100%;
  background: #050505;
  border: 1px solid #333;
  border-radius: 12px;
  color: #fff;
  font-size: 18px;
  outline: none;
  resize: none;
  padding: 14px 16px;
  line-height: 1.6;
  font-family: inherit;
  box-sizing: border-box;
}

textarea::placeholder {
  color: #777;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.action-btn {
  background: #1a472a;
  border: 1px solid #3a7a4a;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s;
}

.action-btn:hover {
  background: #2a5a3a;
}

.hidden {
  display: none;
}

/* ── Auth ── */

.auth-container {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 40px 30px;
  max-width: 400px;
  width: 100%;
  box-sizing: border-box;
}

.auth-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
}

.auth-subtitle {
  color: #888;
  margin: 0 0 30px 0;
  font-size: 16px;
}

.auth-form {
  display: flex;
  flex-direction: column;
}

.auth-input {
  width: 100%;
  background: #050505;
  border: 1px solid #333;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  padding: 12px 14px;
  outline: none;
  margin-bottom: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.auth-input:focus {
  border-color: #555;
}

.auth-button {
  background: #1a472a;
  border: 1px solid #3a7a4a;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s;
}

.auth-button:hover {
  background: #2a5a3a;
}

.auth-button:disabled {
  background: #111;
  cursor: not-allowed;
  border-color: #333;
}

.auth-message {
  padding: 12px;
  border-radius: 6px;
  margin-top: 14px;
  font-size: 14px;
}

.auth-message.success {
  background: #1a3a2a;
  border: 1px solid #3a7a4a;
  color: #8fccaa;
}

.auth-message.error {
  background: #3a1a1a;
  border: 1px solid #7a3a3a;
  color: #cc8f8f;
}

.auth-footer {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-top: 20px;
  margin-bottom: 0;
}

.link {
  color: #8fccaa;
}

/* ── Dashboard ── */

.dashboard-container {
  display: flex;
  height: calc(100vh - 70px);
}

.sidebar {
  width: 200px;
  background: #0a0a0a;
  border-right: 1px solid #111;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.sidebar-btn {
  background: #111;
  border: 1px solid #333;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: background 0.2s;
}

.sidebar-btn:hover {
  background: #1a1a1a;
}

.sidebar-btn.danger {
  color: #cc8f8f;
  border-color: #7a3a3a;
}

.sidebar-btn.danger:hover {
  background: #3a1a1a;
}

.dashboard-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.dashboard-content h2 {
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.result-card {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 20px;
}

.result-card h3 {
  margin: 0 0 12px 0;
  color: #8fccaa;
  font-size: 18px;
}

.result-card p {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: #ccc;
  margin: 0 0 16px 0;
  max-height: 200px;
  overflow-y: auto;
}

.result-card-actions {
  display: flex;
  gap: 10px;
}

.result-delete-btn {
  background: #3a1a1a;
  border: 1px solid #7a3a3a;
  color: #cc8f8f;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.result-delete-btn:hover {
  background: #5a2a2a;
}

.empty-state {
  text-align: center;
  color: #888;
  padding: 40px 20px;
}

/* ── Modal ── */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #0a0a0a;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 30px;
  max-width: 400px;
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 24px;
  cursor: pointer;
}

.modal-close:hover {
  color: #fff;
}

.modal-content h3 {
  margin: 0 0 12px 0;
  font-size: 20px;
}

.modal-content p {
  color: #ccc;
  margin: 0 0 20px 0;
}

.modal-btn {
  display: inline-block;
  background: #1a472a;
  border: 1px solid #3a7a4a;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}

.modal-btn:hover {
  background: #2a5a3a;
}

/* ── Responsive ── */

@media (max-width: 600px) {
  .message { font-size: 17px; }
  textarea  { font-size: 17px; }

  #chat { padding: 28px 16px; }

  .title { font-size: 20px; }

  .header {
    flex-direction: column;
    gap: 12px;
  }

  .header-left { text-align: center; }
  .header-right { justify-content: center; }

  .auth-container {
    padding: 30px 20px;
    max-width: calc(100% - 40px);
  }

  .dashboard-container { flex-direction: column; }

  .sidebar {
    width: 100%;
    flex-shrink: unset;
    border-right: none;
    border-bottom: 1px solid #111;
    flex-direction: row;
    overflow-x: auto;
    padding: 12px 16px;
  }

  .dashboard-content { padding: 20px; }

  .results-grid { grid-template-columns: 1fr; }
}

.link-btn {
  background: none;
  border: none;
  color: #8fccaa;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  font-family: inherit;
}

.link-btn:hover {
  color: #aaddc0;
}
