:root {
  --bg: #0f172a;
  --card: #1e293b;
  --fg: #e2e8f0;
  --muted: #94a3b8;
  --accent: #ef4444;
  --ok: #22c55e;
  --blue: #3b82f6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  padding-bottom: 40px;
}
header { padding: 16px; text-align: center; position: relative; }
h1 { font-size: 1.3rem; margin: 0; }
h2 { font-size: 1rem; color: var(--muted); margin: 20px 0 8px; }
main { max-width: 640px; margin: 0 auto; padding: 0 12px; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 14px;
}
.hidden { display: none !important; }

/* Inspelningsknapp */
.record-card { text-align: center; }
.rec-btn {
  width: 120px; height: 120px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  margin: 0 auto;
  cursor: pointer;
  transition: transform .1s;
}
.rec-btn span { font-size: .8rem; }
.rec-btn:active { transform: scale(.95); }
.rec-btn.recording { background: #b91c1c; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.5); } 50% { box-shadow: 0 0 0 16px rgba(239,68,68,0); } }
.timer { font-size: 1.6rem; font-variant-numeric: tabular-nums; margin-top: 14px; }
.live {
  margin-top: 16px; text-align: left;
  background: #0b1220; border-radius: 12px; padding: 12px;
  max-height: 180px; overflow-y: auto;
}
.live-label { font-size: .75rem; color: var(--muted); margin-bottom: 6px; }

/* Uppladdning */
.upload-btn {
  display: block; text-align: center;
  background: var(--blue); color: white;
  padding: 16px; border-radius: 12px;
  font-weight: 600; cursor: pointer;
}

/* Jobb / lista */
.list-item, .job {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}
.list-item .meta { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.badge { font-size: .7rem; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge.queued, .badge.transcribing, .badge.cleaning { background: #78350f; color: #fde68a; }
.badge.done { background: #14532d; color: #bbf7d0; }
.badge.error { background: #7f1d1d; color: #fecaca; }
.job { cursor: default; }
.spinner { display:inline-block; width:14px; height:14px; border:2px solid var(--muted);
  border-top-color: transparent; border-radius:50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Detaljvy */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 10;
}
.overlay-inner {
  background: var(--bg);
  width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 20px;
  position: relative;
}
.close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--fg); font-size: 1.3rem; cursor: pointer; }
.name-input {
  width: 100%; font-size: 1.1rem; font-weight: 600;
  background: transparent; border: none; border-bottom: 1px solid #334155;
  color: var(--fg); padding: 6px 0; margin-bottom: 12px;
}
.status { font-size: .8rem; color: var(--muted); margin-bottom: 12px; }
.text-label { font-size: .75rem; color: var(--muted); margin: 12px 0 4px; }
.text {
  white-space: pre-wrap; word-wrap: break-word;
  background: var(--card); border-radius: 10px; padding: 12px;
  font-family: inherit; font-size: .9rem; margin: 0;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.actions button, .actions .dl {
  flex: 1 1 auto; text-align: center;
  padding: 12px; border-radius: 10px; border: none;
  background: #334155; color: var(--fg); font-size: .85rem;
  cursor: pointer; text-decoration: none;
}
.actions .danger { background: #7f1d1d; }
.actions #cleanBtn { background: var(--blue); }
