/*
 * Palette is an interim Aidn-aligned set (warm off-white, deep navy, calm blue).
 * Replace with exact hex from designsystem.aidn.no once available; surface
 * Drive links for the official logo + icons (Logo Symbol folder) when refreshing.
 *
 * Typography pairs Nocturno Display Pro (headings) + Inter (UI) per Aidn brand,
 * with Georgia / system-ui fallbacks since the licensed fonts aren't embedded.
 */
:root {
  --bg: #F5F1EC;          /* warm off-white */
  --card: #FFFFFF;         /* surface */
  --text: #0F1A2C;         /* deep navy */
  --muted: #6B7384;        /* slate */
  --border: #E5DED4;
  --accent: #2563AB;       /* calm blue */
  --accent-ink: #FFFFFF;
  --danger: #B33A4F;
  --ok: #1F7A56;
  --warn: #B07A1F;
  --font-display: "Nocturno Display Pro", Georgia, "Times New Roman", serif;
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  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;
}

.app-header {
  margin-bottom: 1.25rem;
  text-align: center;
}

h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.75rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.tagline {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

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

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 26, 44, 0.04);
}

.card.hint:not([hidden]) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #FFF8EC;
  border-color: #E9D9B5;
}
.card.hint p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}

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: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  font-size: 1rem;
  font-family: inherit;
}
input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.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;
}

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

.waveform {
  display: block;
  width: 100%;
  height: 80px;
  margin: 0.25rem 0 1rem;
  background: #FAF7F2;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.waveform[hidden] {
  display: none;
}

.active-mic {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.active-mic[hidden] {
  display: none;
}

.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;
  font-family: inherit;
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text);
  cursor: pointer;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
button.danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}
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: #FAF7F2;
  border: 1px solid var(--border);
  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,
a.small {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 500;
}

a.notion-link {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
  border-radius: 0.6rem;
  text-decoration: none;
  font-family: inherit;
}
#jobs-list .status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
#jobs-list .status .spinner {
  width: 0.75rem;
  height: 0.75rem;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
#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 var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  max-width: 90vw;
}
dialog::backdrop {
  background: rgba(15, 26, 44, 0.45);
}
.transcript-dialog[open] {
  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: #FAF7F2;
  border: 1px solid var(--border);
  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;
  color: var(--text);
}
