:root {
  --bg: #0b0f17;
  --card: #141a26;
  --text: #e8ecf3;
  --muted: #8d97a8;
  --accent: #4f7cff;
  --danger: #e0556e;
  --ok: #4fd185;
  --warn: #e0b34f;
}

* {
  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;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

h1 {
  font-size: 1.5rem;
  margin: 0 0 1rem;
}

h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card {
  background: var(--card);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

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

input,
select {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.75rem;
  background: #0b0f17;
  color: var(--text);
  border: 1px solid #232b3d;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.recorder {
  text-align: center;
}

#status-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
#status-indicator .dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
}
#status-indicator.recording .dot {
  background: var(--danger);
  animation: pulse 1s infinite;
}
#status-indicator.paused .dot {
  background: var(--warn);
}
@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.timer {
  font-size: 3rem;
  font-variant-numeric: tabular-nums;
  margin: 0.5rem 0 1.25rem;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

button {
  flex: 1 1 auto;
  min-width: 6rem;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 0.6rem;
  border: 1px solid #232b3d;
  background: #1c2333;
  color: var(--text);
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
}
button.danger {
  background: var(--danger);
  border-color: var(--danger);
}
button.ghost {
  background: transparent;
}

#jobs-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#jobs-list li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  background: #0b0f17;
  border-radius: 0.5rem;
  font-size: 0.9rem;
}
#jobs-list li .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
#jobs-list li .actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
#jobs-list li .actions:empty {
  display: none;
}
button.small {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
}
#jobs-list .status {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
#jobs-list .status.done {
  color: var(--ok);
}
#jobs-list .status.error {
  color: var(--danger);
}
#jobs-list a {
  color: var(--accent);
  text-decoration: none;
}

dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid #232b3d;
  border-radius: 1rem;
  padding: 1.25rem;
  max-width: 90vw;
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}
.transcript-dialog {
  width: min(90vw, 640px);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.transcript-dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.transcript-dialog header h3 {
  margin: 0;
  font-size: 1rem;
}
.transcript-dialog pre {
  flex: 1 1 auto;
  overflow: auto;
  background: #0b0f17;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  -webkit-user-select: text;
  user-select: text;
}
