/* Meeting Notes PWA — mobile-first, thème clair/sombre, cibles ≥44px. */
:root {
  --c-bg: #f8fafc;
  --c-surface: #ffffff;
  --c-surface-2: #f1f5f9;
  --c-text: #0f172a;
  --c-text-dim: #64748b;
  --c-border: #e2e8f0;
  --c-primary: #2563eb;
  --c-primary-text: #ffffff;
  --c-speaker-default: #64748b;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0f172a;
    --c-surface: #1e293b;
    --c-surface-2: #273449;
    --c-text: #f1f5f9;
    --c-text-dim: #94a3b8;
    --c-border: #334155;
    --c-primary: #3b82f6;
    --c-primary-text: #ffffff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

#shell { min-height: 100dvh; display: flex; flex-direction: column; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}

.app-header .title { flex: 1; font-size: 1.08rem; margin: 0; font-weight: 600; }

.back, .home-link {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--c-primary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
}

.app-view { flex: 1; padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); max-width: 720px; width: 100%; margin: 0 auto; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.tone-neutral { background: var(--c-surface-2); color: var(--c-text-dim); }
.tone-working { background: #e0f2fe; color: #0369a1; }
.tone-done { background: #dcfce7; color: #15803d; }
.tone-action { background: #dbeafe; color: #1d4ed8; }
.tone-error { background: #fee2e2; color: #b91c1c; }
@media (prefers-color-scheme: dark) {
  .tone-working { background: #0c4a6e; color: #7dd3fc; }
  .tone-done { background: #14532d; color: #86efac; }
  .tone-action { background: #1e3a8a; color: #93c5fd; }
  .tone-error { background: #7f1d1d; color: #fecaca; }
}

/* Cards / list */
.card {
  display: block;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
  min-height: 60px;
}
.meeting-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.meeting-title { font-weight: 600; }
.meeting-card-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; color: var(--c-text-dim); font-size: 0.85rem; }
.meta-item { display: inline-flex; align-items: center; gap: 4px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  gap: 8px;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-primary-text); width: 100%; }
.btn-block { width: 100%; }
.btn-small { min-height: 40px; padding: 8px 14px; font-size: 0.9rem; width: auto; }

/* Fields */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; margin-bottom: 6px; font-weight: 600; font-size: 0.95rem; }
.field input[type="text"], .field input[type="file"], textarea, input[type="text"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--c-border);
  border-radius: 12px;
  background: var(--c-surface-2);
  color: var(--c-text);
  font-size: 1rem;
}
textarea { min-height: 96px; resize: vertical; font-family: inherit; }
.hint { font-size: 0.8rem; color: var(--c-text-dim); margin-top: 4px; display: block; }

/* Progress */
.progress { display: flex; align-items: center; gap: 10px; margin: 12px 0; }
.progress.hidden { display: none; }
.progress-bar { flex: 1; height: 12px; border-radius: 999px; background: var(--c-surface-2); overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--c-primary); transition: width 0.2s ease; }
.progress-pct { font-size: 0.85rem; color: var(--c-text-dim); min-width: 42px; text-align: right; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 12px; margin-bottom: 12px; font-size: 0.95rem; }
.alert.hidden { display: none; }
.alert.error { background: #fee2e2; color: #b91c1c; }
.alert.warn { background: #fef3c7; color: #92400e; }
@media (prefers-color-scheme: dark) {
  .alert.error { background: #7f1d1d; color: #fecaca; }
  .alert.warn { background: #78350f; color: #fde68a; }
}
.muted { color: var(--c-text-dim); }
.note { font-size: 0.85rem; }
.empty { padding: 40px 16px; text-align: center; color: var(--c-text-dim); }

/* Transcription */
.tx-seg { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.tx-time { color: var(--c-text-dim); font-variant-numeric: tabular-nums; font-size: 0.8rem; white-space: nowrap; }
.tx-speaker { font-weight: 700; font-size: 0.85rem; color: var(--spk, var(--c-speaker-default)); white-space: nowrap; }
.tx-text { margin: 0; }
.tx-raw { white-space: pre-wrap; }

/* Speaker editor */
.speaker-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0; }
.spk-edit label { font-weight: 700; font-size: 0.8rem; color: var(--c-text-dim); display: block; margin-bottom: 2px; }
.spk-edit input[type="text"] { min-height: 44px; padding: 8px 10px; border-radius: 10px; }

/* Tables (actions / coûts) */
table.actions, table.costs { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.actions th, table.actions td, table.costs th, table.costs td { padding: 8px 6px; border-bottom: 1px solid var(--c-border); text-align: left; vertical-align: top; }
table.actions th, table.costs th { font-size: 0.75rem; text-transform: uppercase; color: var(--c-text-dim); }

/* Email history */
.email-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.email-meta { font-weight: 600; }
.email-date { font-size: 0.8rem; color: var(--c-text-dim); }

/* Report edit */
.report-edit h3 { margin: 12px 0 6px; font-size: 0.95rem; }
.inp-row { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.inp-row input { flex: 1; }
.action-row { display: grid; grid-template-columns: 2fr 1fr 1fr 44px; gap: 6px; margin-bottom: 8px; align-items: center; }
.rm { min-width: 44px; min-height: 44px; border: none; background: transparent; color: var(--c-text-dim); font-size: 1.4rem; cursor: pointer; }

/* Email preview */
.email-preview { border: 1px dashed var(--c-border); border-radius: 12px; padding: 12px; background: var(--c-surface-2); margin: 8px 0 14px; font-size: 0.9rem; }
.mail-line { margin-bottom: 4px; font-weight: 600; }
.email-preview h4 { margin: 10px 0 4px; font-size: 0.9rem; color: var(--c-text-dim); }
.mt { margin-top: 16px; }

/* Sections */
/* Sections */
.section { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 14px; padding: 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.section h2 { margin: 0 0 8px; font-size: 1rem; color: var(--c-text-dim); text-transform: uppercase; letter-spacing: 0.04em; }
.detail-head { margin-bottom: 14px; }