/* BPM Text Export: mobile-first styles. No frameworks, no web fonts. */
:root {
  --navy: #1f3a5f;
  --navy-dark: #142841;
  --navy-soft: #e8eef6;
  --accent: #f59e0b;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #5b6474;
  --border: #dfe4eb;
  --ok: #15803d;
  --ok-bg: #dcfce7;
  --warn: #8a4b06;
  --warn-bg: #fef3c7;
  --bad: #b91c1c;
  --bad-bg: #fee2e2;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .06);
  --tap: 48px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
/* The hidden attribute always wins over component display rules. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  color: var(--text);
  background: var(--bg);
}
a { color: var(--navy); }
a:hover { color: var(--navy-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
img { max-width: 100%; height: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px 12px; z-index: 10; border-radius: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* -- layout --------------------------------------------------------------- */
.container { max-width: 980px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.topbar {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-inner { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .2px; display: flex; align-items: center; gap: 8px; }
.brand:hover { color: #fff; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--navy-dark);
  display: inline-grid; place-items: center; font-weight: 800; font-size: .68rem; letter-spacing: 0; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; text-decoration: underline; cursor: pointer; padding: 6px; }
@media (min-width: 760px) {
  .container { padding: 28px 16px; }
  h1 { font-size: 1.9rem; }
}

/* -- cards, lists ------------------------------------------------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 16px; }
.card > :last-child { margin-bottom: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px; }
.card-head h1 { margin: 0; }
.card-head .btn { white-space: nowrap; }
.card-head h2 { margin: 0; }
.hero { background: linear-gradient(135deg, var(--navy), #2b5486); color: #fff; border: 0; }
.hero p { color: #dbe5f1; }
.hero h1 { color: #fff; }
.get-helper { margin: 16px 0; }
.get-helper-note { font-weight: 600; margin-bottom: 8px; }
.get-helper-other, .get-helper-mac { margin: 8px 0 0; }
.hero .get-helper .btn-primary { background: #fff; color: var(--navy-dark); border-color: #fff; }
.hero .get-helper a:not(.btn) { color: #fff; text-decoration: underline; }
.grid { display: grid; gap: 16px; }
@media (min-width: 760px) { .grid.two { grid-template-columns: 1fr 1fr; } }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 4px; text-decoration: none; color: inherit; min-height: var(--tap); }
a.row:hover, .row-button:hover { background: var(--navy-soft); border-radius: 10px; }
.row-button { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .sub { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.row .chev { color: var(--muted); flex: none; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--navy-soft); color: var(--navy);
  display: grid; place-items: center; font-weight: 700; flex: none; }
.avatar svg { width: 22px; height: 22px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: #9aa6b6; }

/* -- buttons, forms ----------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap);
  padding: 10px 20px; border-radius: 12px; border: 1px solid transparent; font: 600 1rem var(--font);
  text-decoration: none; cursor: pointer; background: var(--navy-soft); color: var(--navy); }
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); color: #fff; }
.btn-accent { background: var(--accent); color: #1f1300; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f3c4c4; }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.05rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

label { font-weight: 600; display: block; margin-bottom: 6px; }
input[type="email"], input[type="text"], input[type="number"], input[type="search"], input[type="date"], select, textarea {
  width: 100%; min-height: var(--tap); padding: 10px 14px; border: 1px solid #c7d0db; border-radius: 12px;
  font: 1rem var(--font); background: #fff; color: var(--text); }
textarea { min-height: 120px; }
input:focus, select:focus, textarea:focus { border-color: var(--navy); outline: 3px solid rgba(31, 58, 95, .15); }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: .875rem; margin-top: 6px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 2px solid var(--border);
  border-radius: 12px; cursor: pointer; font-weight: 500; background: #fff; }
.check input { width: 26px; height: 26px; flex: none; margin: 0; accent-color: var(--navy); }
.check:has(input:checked) { border-color: var(--navy); background: var(--navy-soft); }
.filters { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.filters .wide { grid-column: 1 / -1; }
@media (min-width: 760px) { .filters { grid-template-columns: 2fr 2fr 1fr 1fr auto; align-items: end; }
  .filters .wide { grid-column: auto; } }
.searchbar { display: flex; flex-wrap: wrap; gap: 10px; }
.searchbar .wide { flex: 1 1 220px; }

/* -- badges, notices ----------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem;
  font-weight: 600; background: #eef1f5; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.notice { border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; background: var(--navy-soft); color: var(--navy-dark); }
.notice.ok { background: var(--ok-bg); color: #14532d; }
.notice.warn { background: var(--warn-bg); color: #713f12; }
.notice.bad { background: var(--bad-bg); color: #7f1d1d; }
.notice > :last-child { margin-bottom: 0; }

.spinner { width: 22px; height: 22px; border: 3px solid rgba(31, 58, 95, .2); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .9s linear infinite; flex: none; }
.spinner.light { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.waiting { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; background: var(--navy-soft);
  color: var(--navy-dark); font-weight: 600; }

/* -- tables (become cards on phones) ----------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase;
  letter-spacing: .04em; border-bottom: 1px solid var(--border); padding: 8px; }
.table td { border-bottom: 1px solid var(--border); padding: 10px 8px; vertical-align: top; overflow-wrap: anywhere; }
@media (max-width: 759px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; border-bottom: 1px solid var(--border); padding: 10px 0; }
  .table.stack td { display: flex; gap: 12px; border: 0; padding: 3px 0; }
  .table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; min-width: 96px; flex: none; }
}
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }

/* -- pairing code ------------------------------------------------------- */
.code { font: 700 2.2rem/1.1 var(--mono); letter-spacing: .12em; color: var(--navy-dark); background: #fff;
  border: 2px dashed #9fb2c8; border-radius: 14px; padding: 18px 12px; text-align: center; user-select: all; }
.code span + span { margin-left: .6em; }
@media (min-width: 760px) { .code { font-size: 2.8rem; } }

/* -- threads list ------------------------------------------------------- */
.threads .row { padding: 12px 4px; }
.threads li[hidden] { display: none; }
.count { font-variant-numeric: tabular-nums; }

/* -- setup walkthrough (full screen stepper) -------------------------- */
body.fullscreen { background: #fff; }
.stepper { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 720px; margin: 0 auto; }
.stepper-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.stepper-top .brand { color: var(--navy); }
.stepper-top .brand:hover { color: var(--navy); }
.stepper-top .close { margin-left: auto; width: var(--tap); height: var(--tap); display: grid; place-items: center;
  border-radius: 50%; color: var(--muted); text-decoration: none; font-size: 1.6rem; }
.stepper-top .close:hover { background: #f1f4f8; }
.progress { display: flex; gap: 6px; padding: 0 16px; list-style: none; margin: 0; }
.progress li { flex: 1; height: 6px; border-radius: 6px; background: #e3e8ef; }
.progress li.done { background: var(--ok); }
.progress li.current { background: var(--navy); }
.os-line { padding: 10px 16px 0; font-size: .875rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.os-line svg { width: 18px; height: 18px; flex: none; color: var(--navy); }
.step { flex: 1; padding: 20px 16px 8px; }
.step[hidden] { display: none; }
.step-count { color: var(--muted); font-weight: 600; font-size: .85rem; margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.step h1 { font-size: 1.75rem; margin-bottom: 12px; }
.step .lead { font-size: 1.1rem; color: #253247; }
.shot { margin: 16px 0; }
.shot img { display: block; width: 100%; max-width: 460px; border-radius: 12px; border: 1px solid var(--border); }
.shot figcaption { color: var(--muted); font-size: .8rem; margin-top: 8px; }
.path { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 16px; border-radius: 12px;
  background: #f4f6f9; border: 1px solid var(--border); font-weight: 600; color: #253247; margin: 16px 0; }
.path .sep { color: var(--muted); }
.step-status { margin: 16px 0; }
.step-status .done { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: var(--ok-bg); color: #14532d; font-weight: 700; }
.step-status svg, .notice svg { width: 22px; height: 22px; flex: none; vertical-align: -5px; }
.step .help { margin-top: 12px; }
.step .help summary { cursor: pointer; color: var(--navy); font-weight: 600; min-height: var(--tap); display: flex; align-items: center; }
.fact { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.stepper-actions { position: sticky; bottom: 0; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; }
.stepper-actions .primary-slot { flex: 1; display: flex; gap: 10px; }
.stepper-actions .primary-slot > * { flex: 1; }
@media (min-width: 760px) { .stepper-actions { position: static; border: 0; background: none; padding: 8px 16px 32px; }
  .step h1 { font-size: 2.1rem; } }
.switcher[hidden] { display: none; }
.switcher { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); display: grid; place-items: end center; z-index: 20; }
.switcher .sheet { background: #fff; width: 100%; max-width: 520px; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 760px) { .switcher { place-items: center; } .switcher .sheet { border-radius: 18px; } }
.choice-grid { display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2px solid var(--border); border-radius: 12px;
  text-decoration: none; color: var(--text); font-weight: 600; min-height: 56px; }
.choice:hover, .choice[aria-current="true"] { border-color: var(--navy); background: var(--navy-soft); }
.choice svg { width: 26px; height: 26px; color: var(--navy); }

/* -- details list ------------------------------------------------------ */
.report-meta { display: grid; gap: 0; margin: 12px 0 0; }
.report-meta div { display: grid; grid-template-columns: 7rem 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.report-meta div:first-child { border-top: 0; }
.report-meta dt { color: var(--muted); font-weight: 600; }
.report-meta dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) { .report-meta div { grid-template-columns: 1fr; gap: 0; } }

/* -- picker ------------------------------------------------------------- */
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
.search .btn { padding: 10px 14px; }
.picker-card { padding: 8px 16px; }
.picker-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--border); }
.pick { display: flex; align-items: center; gap: 12px; padding: 12px 4px; cursor: pointer; font-weight: 400; margin: 0;
  min-height: var(--tap); }
.pick:hover { background: var(--navy-soft); border-radius: 10px; }
.pick input { width: 24px; height: 24px; flex: none; margin: 0; accent-color: var(--navy); }
.pick:has(input:checked) .title { color: var(--navy); }
.pick .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pick .title { font-weight: 600; overflow-wrap: anywhere; }
.num { white-space: nowrap; font-weight: 500; color: #384457; }
.pick .sub, .picked .sub { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; display: block; }
.pick .people, .picked .people { color: #384457; }
.picked .row { padding: 10px 0; }
.picked .grow { display: flex; flex-direction: column; }
.picked.compact .avatar { width: 32px; height: 32px; }
.picked.compact .avatar svg { width: 18px; height: 18px; }
.card-title { font-size: 1rem; margin: 4px 0 4px; }
.sticky-bar { position: sticky; bottom: 0; z-index: 4; margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(244, 246, 249, 0), var(--bg) 30%); }
@media (min-width: 760px) { .sticky-bar { margin: 0; padding-left: 0; padding-right: 0; } }

/* -- progress and done --------------------------------------------------- */
.done-card { text-align: center; padding: 32px 20px; }
.done-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok); margin-bottom: 12px; }
.done-icon svg { width: 34px; height: 34px; }
.done-card h1:focus { outline: none; }
[data-run-active] ol { margin: 16px 0; padding-left: 20px; }
.how { padding-left: 20px; }
.how li { margin-bottom: 8px; }
.plain { list-style: none; margin: 0; padding: 0; }
.plain li { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.plain svg { width: 22px; height: 22px; flex: none; color: var(--navy); margin-top: 1px; }

footer.page-foot { color: var(--muted); font-size: .8rem; text-align: center; padding: 24px 16px 8px; }

/* A drawing (not a screenshot) of a macOS alert, so people know which button to click. */
.mac-dialog { margin: 16px 0; }
.mac-dialog-box { max-width: 300px; margin: 0 auto; padding: 18px 16px 14px; border-radius: 14px; background: #f2f2f4;
  border: 1px solid #d0d0d6; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); text-align: center; color: #1d1d1f; }
.mac-dialog-title { font-weight: 700; margin: 0 0 6px; }
.mac-dialog-message { font-size: .85rem; margin: 0 0 14px; }
.mac-dialog-buttons { display: flex; gap: 8px; }
.mac-dialog-button { flex: 1; padding: 6px 8px; border-radius: 7px; background: #e1e1e6; font-size: .85rem; }
.mac-dialog-button.is-target { background: #0a7aff; color: #fff; font-weight: 600; outline: 3px solid #f59e0b; outline-offset: 2px; }
.mac-dialog figcaption { text-align: center; margin-top: 10px; font-size: .875rem; color: var(--muted); }
.settings-link { margin: 16px 0; }
.settings-link p { margin: 8px 0 0; }
.fallback-steps { margin: 8px 0 0; padding-left: 1.25rem; }
.fallback-steps li { margin-bottom: 6px; }
