:root {
  color-scheme: light dark;
  --bg: #f5f5f5;
  --card-bg: #fffffffb;
  --border: #cfd8dc;
  --accent: #00695c;
  --accent-hover: #005247;
  --danger: #c62828;
  --danger-hover: #b71c1c;
  --text: #263238;
  --muted: #607d8b;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

header {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

header h1 {
  margin: 0;
  font-size: 2rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 12px 32px rgba(38, 50, 56, 0.05);
}

.card h2 {
  margin-top: 0;
  font-size: 1.35rem;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

textarea, input[type="search"] {
  font: inherit;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  resize: vertical;
}

textarea:focus, input[type="search"]:focus {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

.form-actions {
  display: flex;
  gap: 1rem;
}

button {
  font: inherit;
  padding: 0.55rem 1.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--accent-hover);
}

button.secondary {
  background: #eceff1;
  color: var(--text);
}

button.secondary:hover {
  background: #dde5ea;
}

button.link {
  background: transparent;
  border: none;
  padding: 0.25rem 0.5rem;
  color: var(--accent);
  border-radius: 6px;
}

button.link:hover {
  background: rgba(0, 105, 92, 0.1);
}

button.link.danger {
  color: var(--danger);
}

button.link.danger:hover {
  background: rgba(198, 40, 40, 0.12);
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th, td {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
}

tbody tr:hover {
  background: rgba(0, 105, 92, 0.07);
}

.col-question, .col-answer {
  max-width: 320px;
  white-space: pre-line;
}

.col-embedding {
  font-size: 0.85rem;
  color: var(--muted);
}

.empty {
  text-align: center;
  color: var(--muted);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

#search {
  max-width: 260px;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
}

.feedback {
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.feedback.error {
  color: var(--danger);
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem 2rem;
  }

  table {
    min-width: 100%;
  }
}
