:root {
  --bg: #0b0d12;
  --panel: #151821;
  --border: #262b38;
  --text: #e8eaf0;
  --muted: #8b91a3;
  --accent: #6c8cff;
  --accent-hover: #5a7cf2;
  --good: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --hot: #f87171;
}

* { box-sizing: border-box; }

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

main {
  width: 100%;
  max-width: 720px;
  padding: 48px 24px;
}

h1 { margin: 0 0 4px; font-size: 32px; letter-spacing: -0.02em; }
.subtitle { margin: 0 0 32px; color: var(--muted); }

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.span-2 { grid-column: span 2; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 15px;
}

button {
  background: var(--accent);
  color: white;
  border: 0;
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s, border-color 0.15s;
}
button:active:not(:disabled) { transform: scale(0.99); }

.record {
  width: 100%;
  margin-bottom: 16px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  user-select: none;
  font-weight: 500;
}
.record:hover:not(:disabled) {
  background: #1c2030;
  border-color: var(--accent);
}
.record.recording {
  background: var(--hot);
  border-color: var(--hot);
  color: white;
}
.record:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
}
.status.idle { color: var(--muted); }
.status.recording { color: var(--bad); }
.status.processing { color: var(--warn); }
.status.done { color: var(--good); }
.status.error { color: var(--bad); }

.transcripts { display: grid; gap: 16px; }

h2 {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.bubble {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  min-height: 48px;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Public landing page ---------- */

.landing {
  max-width: 480px;
  margin: 0 auto;
  padding: 96px 24px 24px;
  text-align: center;
}

.landing-title {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  color: #f0f0f0;
}

.landing-tagline {
  font-size: 18px;
  color: #888;
  margin: 0 0 48px;
}

.landing-actions {
  display: flex;
  justify-content: center;
}

.btn-primary {
  background: #f0f0f0;
  color: #000;
  border: none;
  border-radius: 10px;
  padding: 12px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms ease, transform 120ms ease;
}

.btn-primary:hover {
  background: #fff;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* ---------- User menu (top-right of the translator page) ----------
   Targets the ID rather than the class, because Clerk's mountUserButton
   overwrites the element's className with its own cl-* classes. */

#user-menu {
  position: fixed !important;
  top: 16px !important;
  right: 16px !important;
  z-index: 100;
}

/* ---------- Admin page ---------- */

.admin {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 32px;
  margin: 0 0 4px;
  letter-spacing: -0.02em;
}

.admin-subtitle {
  color: #888;
  font-size: 14px;
  margin: 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.stat-label {
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

.admin-section {
  margin-bottom: 48px;
}

.admin-section h2 {
  font-size: 18px;
  margin: 0 0 12px;
  font-weight: 600;
}

.admin-section .dim {
  color: #666;
  font-weight: 400;
  font-size: 14px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  background: rgba(255, 255, 255, 0.03);
  font-weight: 600;
  color: #aaa;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table .truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
