:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --red: #dc2626;
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  /* учёт «чёлки» iPhone */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); font-size: 0.9em; }

.screen { max-width: 680px; margin: 0 auto; padding: 0 16px 40px; }

/* --- Настройка --- */
#setup { display: flex; min-height: 80vh; align-items: center; }
.card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card h1 { margin: 0 0 4px; font-size: 1.5em; }
label { display: block; margin: 18px 0 0; font-size: 0.9em; color: var(--muted); }
input[type=text] {
  width: 100%;
  margin-top: 6px;
  padding: 13px 14px;
  font-size: 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
input:focus { outline: none; border-color: var(--blue); }

button { font-family: inherit; cursor: pointer; border: none; }
button.primary {
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border-radius: 10px;
}
button.primary:active { background: var(--blue-dark); }

/* --- Верхняя панель --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.brand { font-weight: 700; font-size: 1.15em; }
.icon-btn {
  background: none;
  font-size: 1.1em;
  color: var(--blue);
  padding: 6px 8px;
  border-radius: 8px;
}
.icon-btn:active { background: var(--border); }

/* --- Запись --- */
.record-area { text-align: center; padding: 24px 0 8px; }
button.record {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 30px;
  font-size: 1.15em;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(37,99,235,.35);
}
button.record:active { transform: scale(.98); }
button.record.recording { background: var(--red); box-shadow: 0 4px 14px rgba(220,38,38,.4); }
button.record:disabled { opacity: .6; }
.rec-dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff;
}
button.record.recording .rec-dot { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.timer { font-size: 2em; font-variant-numeric: tabular-nums; margin: 16px 0 4px; }
.status { color: var(--muted); min-height: 1.4em; }
button.retry {
  margin-top: 14px;
  padding: 12px 22px;
  font-size: 1em;
  font-weight: 600;
  color: #fff;
  background: var(--red);
  border-radius: 999px;
}
button.retry:active { opacity: .85; }
.status.busy { color: var(--blue); }
.status.error { color: var(--red); }
.status.ok { color: #16a34a; }

/* --- Список встреч --- */
.list-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 18px; font-weight: 600; color: var(--muted);
}
.meeting-list { list-style: none; margin: 8px 0 0; padding: 0; }
.meeting-list li {
  background: var(--card);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(0,0,0,.05);
  display: flex;
  align-items: center;
  gap: 10px;
}
.meeting-list li:active { background: #f8fafc; }
.m-title { font-weight: 600; flex: 1; }
.m-date { font-size: 0.8em; color: var(--muted); }
.m-badge { font-size: 0.85em; }
.badge-processing { color: var(--blue); }
.badge-error { color: var(--red); }

/* --- Детали --- */
.detail-body { padding-top: 8px; line-height: 1.5; }
.detail-body h2 { font-size: 1.05em; margin: 22px 0 8px; color: var(--muted); }
.detail-body .summary { background: var(--card); padding: 16px; border-radius: 12px; }
.detail-body ul { margin: 0; padding-left: 20px; }
.detail-body li { margin: 4px 0; }
.task { background: var(--card); padding: 10px 14px; border-radius: 10px; margin: 6px 0; }
.task .meta { font-size: 0.85em; color: var(--muted); }
.transcript {
  white-space: pre-wrap;
  background: var(--card);
  padding: 14px;
  border-radius: 12px;
  font-size: 0.95em;
}
