:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --panel-light: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dark: #0284c7;
  --error: #f87171;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 640px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

h1 { font-size: 1.4rem; margin: 0 0 4px; }
h2 { font-size: 1rem; margin: 24px 0 8px; color: var(--text-muted); }
.subtitle { color: var(--text-muted); margin: 0 0 24px; font-size: 0.9rem; }

label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 6px; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--panel-light);
  border-radius: 6px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
}

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

button {
  background: var(--accent-dark);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 12px;
}
button:hover:not(:disabled) { background: var(--accent); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.secondary { background: var(--panel-light); }
button.danger { background: #b91c1c; }

.error { color: var(--error); font-size: 0.85rem; margin-top: 8px; }
.hint { color: var(--text-muted); font-size: 0.8rem; margin-top: 6px; }

.chat-log { display: flex; flex-direction: column; gap: 14px; margin: 20px 0; max-height: 50vh; overflow-y: auto; }
.msg { padding: 12px 14px; border-radius: 8px; font-size: 0.92rem; line-height: 1.5; }
.msg.question { background: var(--panel-light); align-self: flex-end; max-width: 85%; }
.msg.answer { background: #0c4a6e; max-width: 85%; }

.status-row { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); margin-top: 6px; }

.qa-item, .tan-item {
  background: var(--bg);
  border: 1px solid var(--panel-light);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.qa-item .actions, .tan-item .actions { margin-top: 8px; display: flex; gap: 8px; }
.qa-item .actions button, .tan-item .actions button { margin-top: 0; }

.tan-plain {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 1.3rem;
  letter-spacing: 2px;
  background: var(--bg);
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 12px;
  margin: 12px 0;
  text-align: center;
}

.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs button { margin-top: 0; background: var(--panel-light); }
.tabs button.active { background: var(--accent-dark); }

.hidden { display: none !important; }
