/* Quorum first-run setup — calm, light, one accent (deep teal). */
:root {
  --accent: #2f6f62;
  --accent-strong: #245a4f;
  --accent-soft: #e8f2ef;
  --accent-ring: rgba(47, 111, 98, 0.28);

  --ink: #1d2427;
  --ink-2: #4a5458;
  --ink-3: #6b7579;
  --line: #e2e6e7;
  --line-2: #d0d6d8;
  --bg: #f6f7f6;
  --surface: #ffffff;
  --warn-bg: #fdf6e7;
  --warn-line: #ecd9a8;
  --warn-ink: #6b4f12;
  --error: #b3261e;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 30, 30, 0.04), 0 4px 16px rgba(20, 30, 30, 0.05);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 650; letter-spacing: -0.01em; }
h1:focus { outline: none; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 3px solid var(--accent-ring); outline-offset: 2px; border-radius: 6px; }

/* ---------- Top bar ---------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 880px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 0.9rem;
}
.brand-name { font-weight: 650; font-size: 1.05rem; }
.link-btn {
  background: none; border: 0; padding: 6px 4px; cursor: pointer;
  color: var(--ink-3); font-size: 0.9rem; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); }
.link-btn--accent { color: var(--accent); font-weight: 600; }
.link-btn--accent:hover { color: var(--accent-strong); }

/* ---------- Layout ---------- */
.wizard { max-width: 880px; margin: 0 auto; padding: 28px 24px 64px; }

/* ---------- Progress ---------- */
.progress { margin-bottom: 20px; }
.progress-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}
.progress-item { display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; color: var(--ink-3); }
.progress-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress-bar::after { content: ""; display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease; }
.progress-item.is-done .progress-bar::after,
.progress-item.is-current .progress-bar::after { width: 100%; }
.progress-item.is-current .progress-bar::after { opacity: 0.55; }
.progress-label { display: flex; align-items: center; gap: 6px; }
.progress-num {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--line-2); display: grid; place-items: center;
  font-size: 0.72rem; font-weight: 650; color: var(--ink-3); background: var(--surface);
}
.progress-item.is-current { color: var(--ink); font-weight: 600; }
.progress-item.is-current .progress-num { border-color: var(--accent); color: var(--accent); }
.progress-item.is-done { color: var(--ink-2); }
.progress-item.is-done .progress-num { background: var(--accent); border-color: var(--accent); color: #fff; }
.progress-compact { display: none; font-size: 0.9rem; color: var(--ink-2); margin: 0 0 8px; }
.progress-compact strong { color: var(--ink); }

/* ---------- Edit banner ---------- */
.edit-banner {
  background: var(--accent-soft); border: 1px solid #cfe3dd; color: var(--accent-strong);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-size: 0.93rem;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px;
}
.step-sub { color: var(--ink-2); margin: 8px 0 24px; max-width: 62ch; }

/* ---------- Step 1: connect ---------- */
.connect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.connect-option {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 18px; border: 1.5px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s;
  min-height: 76px;
}
.connect-option:hover { border-color: var(--accent); background: #fbfdfc; }
.connect-option[disabled] { cursor: default; opacity: 0.55; }
.connect-option[disabled]:hover { border-color: var(--line-2); background: var(--surface); }
.connect-option.is-selected { border-color: var(--accent); background: var(--accent-soft); opacity: 1; }
.connect-icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
  background: #f1f3f3; color: var(--ink-2); border: 1px solid var(--line);
}
.connect-text { display: flex; flex-direction: column; }
.connect-title { font-weight: 600; }
.connect-desc { font-size: 0.88rem; color: var(--ink-3); }

.connect-status {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fafbfb;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.connect-status.is-connected { background: var(--accent-soft); border-color: #cfe3dd; }
.connect-status-text { flex: 1 1 240px; }
.connect-status-text strong { display: block; }
.connect-status-text span { font-size: 0.9rem; color: var(--ink-2); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--line-2); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Errors / warnings ---------- */
.field-error {
  color: var(--error); font-size: 0.93rem; margin: 12px 0 0;
  display: flex; align-items: center; gap: 8px;
}
.field-error::before {
  content: "!"; width: 18px; height: 18px; border-radius: 50%; background: var(--error); color: #fff;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; flex: none;
}
.has-error .connect-option, .has-error .option-row { border-color: #e3b4b0; }
.soft-warning {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); font-size: 0.93rem;
}

/* ---------- Step 2: options ---------- */
.options-list { display: grid; gap: 10px; }
.option-row {
  display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.option-row:hover { border-color: var(--accent); }
.option-row.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.option-row input { margin: 4px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.option-main { display: flex; flex-direction: column; }
.option-title { font-weight: 600; }
.option-desc { font-size: 0.9rem; color: var(--ink-2); }

/* ---------- Meeting preview list ---------- */
.meeting-preview { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.preview-heading { font-size: 1.02rem; font-weight: 650; }
.preview-sub { color: var(--ink-3); font-size: 0.9rem; margin: 4px 0 0; }
.meeting-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.meeting-item {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fcfcfc;
}
.meeting-title { font-weight: 600; font-size: 0.97rem; }
.meeting-when { font-size: 0.86rem; color: var(--ink-3); grid-column: 1; }
.meeting-reason { font-size: 0.86rem; color: var(--ink-2); grid-column: 1 / -1; }
.meeting-pill {
  grid-row: 1 / span 2; grid-column: 2; justify-self: end;
  font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
}
.meeting-pill.is-record { background: var(--accent); border-color: var(--accent); color: #fff; }
.meeting-pill.is-ask { background: var(--accent-soft); border-color: #cfe3dd; color: var(--accent-strong); }
.meeting-empty { color: var(--ink-3); font-size: 0.93rem; padding: 12px 0; }

/* ---------- Step 3: privacy ---------- */
.defaults-banner {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  background: var(--accent-soft); border: 1px solid #cfe3dd; color: var(--accent-strong); font-size: 0.95rem;
}
.defaults-banner.is-changed { background: #fafbfb; border-color: var(--line); color: var(--ink-2); }
.defaults-banner-icon {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; flex: none;
  display: grid; place-items: center; font-size: 0.75rem; font-weight: 700; margin-top: 1px;
}
.defaults-banner.is-changed .defaults-banner-icon { background: var(--ink-3); }
.toggle-list { display: grid; gap: 10px; }
.toggle-row {
  display: flex; gap: 16px; align-items: flex-start; justify-content: space-between;
  padding: 16px; border: 1.5px solid var(--line-2); border-radius: var(--radius);
}
.toggle-row.is-on { border-color: #b9d6ce; }
.toggle-main { flex: 1; }
.toggle-title { font-weight: 600; margin-right: 8px; }
.toggle-badge {
  display: inline-block; font-size: 0.76rem; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); border: 1px solid #cfe3dd; vertical-align: 2px;
}
.toggle-badge.is-changed { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.toggle-why { margin: 6px 0 0; font-size: 0.9rem; color: var(--ink-2); }
.toggle-why strong { color: var(--ink); font-weight: 600; }
.toggle-restore { font-size: 0.86rem; padding: 4px 0 0; }
.toggle-switch {
  position: relative; width: 48px; height: 28px; border-radius: 999px; flex: none; margin-top: 2px;
  border: 0; padding: 0; cursor: pointer; background: #c7cdcf; transition: background 0.18s;
}
.toggle-switch[aria-checked="true"] { background: var(--accent); }
.toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform 0.18s;
}
.toggle-switch[aria-checked="true"] .toggle-knob { transform: translateX(20px); }
.toggle-state { display: block; font-size: 0.76rem; text-align: center; color: var(--ink-3); margin-top: 4px; font-weight: 600; }
.toggle-control { display: flex; flex-direction: column; align-items: center; }

/* ---------- Step 4: preview ---------- */
.sample-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px;
  padding: 12px 16px; border-radius: var(--radius-sm); background: #fafbfb; border: 1px solid var(--line);
  margin-bottom: 16px;
}
.sample-meta-title { font-weight: 650; }
.sample-meta-sub { color: var(--ink-3); font-size: 0.9rem; }
.sample-tag {
  font-size: 0.74rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--ink-3); border: 1px solid var(--line-2); padding: 1px 7px; border-radius: 4px;
}
.preview-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; align-items: start; }
.preview-pane { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); }
.preview-pane-heading {
  font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); font-weight: 650;
  margin-bottom: 12px;
}
.agenda-list, .summary-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.agenda-btn, .summary-btn {
  width: 100%; text-align: left; cursor: pointer; display: flex; gap: 10px; align-items: flex-start;
  padding: 10px; border-radius: var(--radius-sm); border: 1.5px solid transparent; background: transparent;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.agenda-btn:hover, .summary-btn:hover { background: #f4f6f6; }
.agenda-num, .src-chip {
  width: 24px; height: 24px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 700; background: #eef1f1; color: var(--ink-2); border: 1px solid var(--line-2);
}
.agenda-body, .summary-body { display: flex; flex-direction: column; min-width: 0; }
.agenda-title { font-weight: 600; font-size: 0.95rem; }
.agenda-meta { font-size: 0.84rem; color: var(--ink-3); }
.agenda-count { font-size: 0.8rem; color: var(--accent-strong); margin-top: 2px; }
.summary-group-label {
  font-size: 0.8rem; font-weight: 650; color: var(--ink-2); margin: 10px 0 2px; padding-left: 10px;
}
.summary-group-label:first-child { margin-top: 0; }
.summary-text { font-size: 0.95rem; }
.summary-src { font-size: 0.82rem; color: var(--ink-3); margin-top: 2px; }
.summary-src q { font-style: italic; quotes: "“" "”"; }
.is-linked .agenda-btn.is-active, .is-linked .summary-btn.is-active {
  background: var(--accent-soft); border-color: #b9d6ce;
}
.is-linked .agenda-btn.is-active .agenda-num, .is-linked .summary-btn.is-active .src-chip {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.is-linked .agenda-btn:not(.is-active), .is-linked .summary-btn:not(.is-active) { opacity: 0.5; }
.preview-hint { color: var(--ink-3); font-size: 0.88rem; margin: 12px 0 0; }

/* ---------- Step 5: finished ---------- */
.finish-check {
  width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700; margin-bottom: 14px;
}
.next-meeting-callout {
  border: 1.5px solid #b9d6ce; background: var(--accent-soft); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 28px;
}
.callout-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent-strong); font-weight: 650; }
.callout-title { font-size: 1.12rem; font-weight: 650; margin: 4px 0 2px; }
.callout-when { color: var(--ink-2); font-size: 0.93rem; }
.callout-steps { margin: 12px 0 0; padding-left: 20px; color: var(--ink); }
.callout-steps li { margin: 4px 0; }
.callout-note { margin: 12px 0 0; font-size: 0.92rem; color: var(--ink-2); border-top: 1px solid #cfe3dd; padding-top: 10px; }
.callout-note.is-warn { color: var(--warn-ink); }
.review-heading { font-size: 1.02rem; font-weight: 650; margin-bottom: 10px; }
.review-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.review-item { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; padding: 14px 16px; }
.review-item + .review-item { border-top: 1px solid var(--line); }
.review-label { font-size: 0.84rem; color: var(--ink-3); font-weight: 600; }
.review-value { font-size: 0.97rem; }
.review-value small { display: block; color: var(--ink-3); font-size: 0.86rem; }
.review-edit { flex: none; padding: 2px 4px; font-size: 0.93rem; }

/* ---------- Nav ---------- */
.nav-bar { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.nav-spacer { flex: 1; }
.btn {
  min-height: 44px; padding: 10px 22px; border-radius: 10px; cursor: pointer;
  font-weight: 600; font-size: 0.98rem; border: 1.5px solid transparent; transition: background 0.15s, border-color 0.15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink-3); }
.btn-small { min-height: 36px; padding: 6px 14px; font-size: 0.9rem; }

/* ---------- Consent dialog (simulated OAuth) ---------- */
.consent {
  border: 0; padding: 0; border-radius: 14px; width: min(520px, calc(100vw - 32px));
  box-shadow: 0 20px 60px rgba(20, 30, 30, 0.25); color: var(--ink);
}
.consent::backdrop { background: rgba(29, 36, 39, 0.45); }
.consent-inner { padding: 24px; }
.consent-provider { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 16px; }
.consent-provider .connect-icon { width: 32px; height: 32px; font-size: 0.9rem; }
.consent-sim {
  margin-left: auto; font-size: 0.74rem; font-weight: 650; color: var(--ink-3);
  border: 1px dashed var(--line-2); padding: 2px 8px; border-radius: 999px;
}
.consent h2 { font-size: 1.2rem; font-weight: 650; }
.consent-account { color: var(--ink-2); font-size: 0.93rem; margin: 6px 0 16px; }
.consent-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.consent h3 { font-size: 0.86rem; font-weight: 650; margin-bottom: 6px; }
.consent-list { margin: 0; padding: 0; list-style: none; font-size: 0.9rem; color: var(--ink-2); display: grid; gap: 6px; }
.consent-list li { padding-left: 22px; position: relative; }
.consent-list li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.consent-list--yes li::before { content: "✓"; color: var(--accent); }
.consent-list--no li::before { content: "✕"; color: var(--ink-3); }
.consent-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .preview-split { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  h1 { font-size: 1.35rem; }
  .topbar-inner { padding: 12px 16px; }
  .wizard { padding: 16px 12px 40px; }
  .card { padding: 20px 16px; }
  .connect-grid { grid-template-columns: 1fr; }
  .progress-list { gap: 4px; }
  .progress-item .progress-label { display: none; }
  .progress-compact { display: block; }
  .toggle-row { padding: 14px; gap: 12px; }
  .consent-cols { grid-template-columns: 1fr; }
  .review-item { padding: 12px; }
  .nav-bar { position: sticky; bottom: 0; background: var(--bg); padding: 10px 0; margin-top: 12px; }
  .nav-bar .btn { flex: 1; }
  .nav-spacer { display: none; }
  .meeting-item { grid-template-columns: 1fr; }
  .meeting-pill { grid-row: auto; grid-column: 1; justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation-duration: 0.01ms !important; }
}

/* ---------- v2 additions ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.info-note {
  margin: 14px 0 0; padding: 10px 14px; border-radius: var(--radius-sm);
  background: #fafbfb; border: 1px solid var(--line); color: var(--ink-2); font-size: 0.92rem;
}
.info-note.soft-warning { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-ink); }
.toggle-effect { color: var(--ink-3); font-size: 0.86rem; }
.callout-outcome { margin: 12px 0 0; }

/* ---------- Touch & narrow-screen preview ---------- */
html { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .connect-option:hover { border-color: var(--line-2); background: var(--surface); }
  .connect-option.is-selected:hover { border-color: var(--accent); background: var(--accent-soft); }
  .option-row:hover { border-color: var(--line-2); }
  .option-row.is-selected:hover { border-color: var(--accent); }
  .agenda-btn:hover, .summary-btn:hover { background: transparent; }
  .btn-primary:hover { background: var(--accent); }
}
@media (max-width: 720px) {
  /* Keep the agenda next to the summary while scrolling: a compact sticky strip. */
  .preview-split { gap: 10px; }
  .preview-pane--agenda {
    position: sticky; top: 0; z-index: 2; padding: 10px;
    box-shadow: 0 6px 12px -8px rgba(20, 30, 30, 0.18);
  }
  .preview-pane--agenda .preview-pane-heading { margin-bottom: 6px; }
  .preview-pane--agenda .agenda-list { grid-template-columns: 1fr 1fr; gap: 4px; }
  .preview-pane--agenda .agenda-btn { padding: 6px; gap: 6px; align-items: center; }
  .preview-pane--agenda .agenda-meta, .preview-pane--agenda .agenda-count { display: none; }
  .preview-pane--agenda .agenda-title { font-size: 0.84rem; line-height: 1.25; }
  .preview-pane--agenda .agenda-num { width: 22px; height: 22px; font-size: 0.74rem; }
  .preview-pane--summary { padding: 12px 8px; }
}
