/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --bg: #1a1d21;
  --panel: #232629;
  --panel-raised: #292c30;
  --border: #383c41;
  --text: #ecebe6;
  --text-muted: #92969b;

  --record: #e5402b;
  --record-soft: #3d241f;
  --info: #4c82ac;
  --info-soft: #1f2b33;
  --done: #5fa36f;
  --done-soft: #1e2b21;

  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Consolas, monospace;
  --font-sans: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
}

body {
  display: flex;
  justify-content: center;
  padding: 0 16px;
}

button {
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}

.console {
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ────────────────────────────────────────────────────────── */
.console__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 4px 16px;
  border-bottom: 1px solid var(--border);
}

.console__brand {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.console__brand::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--done);
  margin-right: 8px;
  vertical-align: middle;
}

.console__tabs {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
}

.tab {
  background: transparent;
  border: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: var(--text-muted);
}

.tab.is-active {
  background: var(--panel-raised);
  color: var(--text);
}

/* ── Views ──────────────────────────────────────────────────────────── */
main { flex: 1; padding: 32px 4px 48px; }
.view { display: none; }
.view.is-active { display: block; }

/* ── Record view ────────────────────────────────────────────────────── */
.record-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 0 8px;
}

.topic-input {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 40px;
  text-align: center;
}
.topic-input::placeholder { color: var(--text-muted); }

.record-btn {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--panel);
  border: 2px solid var(--record);
  display: flex;
  align-items: center;
  justify-content: center;
}

.record-btn__dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--record);
  transition: border-radius 0.2s ease;
}

.record-btn.is-recording .record-btn__dot {
  border-radius: 6px; /* square = "stop", the universal transport-control swap */
  width: 34px;
  height: 34px;
}

.record-btn.is-recording {
  animation: pulse-ring 1.6s ease-out infinite;
}

@keyframes pulse-ring {
  0%   { box-shadow: 0 0 0 0 rgba(229, 64, 43, 0.45); }
  70%  { box-shadow: 0 0 0 18px rgba(229, 64, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(229, 64, 43, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .record-btn.is-recording { animation: none; }
}

.record-status {
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}

.record-timer {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  min-height: 34px;
}

.record-hint {
  margin-top: 28px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
}

.processing-log {
  margin-top: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--info);
  min-height: 20px;
}

.error-banner {
  margin-top: 24px;
  background: var(--record-soft);
  border: 1px solid var(--record);
  color: var(--text);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  max-width: 420px;
  text-align: left;
}

/* ── Minutes detail (shared: record result + history detail) ─────────── */
.minutes {
  margin-top: 36px;
  text-align: left;
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.minutes__subject {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 10px;
}

.minutes__summary {
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 24px;
}

.minutes__section-label {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.minutes ul {
  margin: 0 0 24px;
  padding-left: 20px;
  line-height: 1.7;
}

.minutes__action-item strong { color: var(--info); font-weight: 500; }

.minutes__attendees {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.minutes__attendee {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
}

.minutes__transcript-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
}

.minutes__transcript {
  display: none;
  white-space: pre-wrap;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
  max-height: 320px;
  overflow-y: auto;
}
.minutes__transcript.is-visible { display: block; }

/* ── History view ───────────────────────────────────────────────────── */
.history-search {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}
.history-search::placeholder { color: var(--text-muted); }

.history-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 16px 4px;
}

.history-row__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.history-row__subject { font-size: 16px; font-weight: 500; margin-bottom: 4px; }
.history-row__summary { font-size: 14px; color: var(--text-muted); }

.history-empty {
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 4px;
  text-align: center;
}

.history-detail {
  margin-bottom: 20px;
}

.back-link {
  background: none;
  border: none;
  color: var(--info);
  font-size: 14px;
  padding: 0 0 20px;
}
