/* event-scraper - the outbound campaign app
   =========================================================================
   Direction: warm editorial. A paper-white page, one deep ink, one teal that
   ONLY ever means "this is the action" or "this is live". Titles are set in a
   serif at a size the body text never comes near, so every page announces
   what it is before you read a word of it; everything else is a quiet
   grotesque. Readable across a room, which is the point on a projector.

   Layout is mobile-first. Navigation is a bottom tab bar under 760px (five
   destinations, thumb-reachable) and a top rail above it. Wide tables scroll
   inside their own container and never take the page sideways with them.   */

:root {
  --paper:      #f7f5f0;
  --paper-2:    #fdfcfa;
  --surface:    #ffffff;
  --ink:        #17202a;
  --ink-2:      #4c5865;
  --ink-3:      #808c99;
  --line:       #e6e1d6;
  --line-2:     #d5cfc2;

  --accent:     #0f5c73;
  --accent-2:   #14758f;
  --accent-soft:#e6f0f3;
  --accent-ink: #ffffff;

  --ok-bg:   #e8f2eb;  --ok-ink:   #1d6b45;  --ok-line:  #c2e0cf;
  --warn-bg: #fbf1db;  --warn-ink: #855510;  --warn-line:#eed8a6;
  --bad-bg:  #fbe7e3;  --bad-ink:  #a03429;  --bad-line: #f0c4bd;
  --cool-bg: #e9eef4;  --cool-ink: #2b4a64;  --cool-line:#c8d7e5;
  --mute-bg: #efece5;  --mute-ink: #66707c;  --mute-line:#ded8cc;

  --r:    12px;
  --r-sm: 7px;
  --r-pill: 999px;

  --shadow-1: 0 1px 2px rgba(23,32,42,.05);
  --shadow-2: 0 1px 2px rgba(23,32,42,.06), 0 10px 30px -18px rgba(23,32,42,.35);
  --shadow-3: 0 2px 6px rgba(23,32,42,.07), 0 24px 60px -28px rgba(23,32,42,.4);

  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
           Georgia, "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --step: 4px;
  --gutter: clamp(16px, 4vw, 40px);
  --nav-h: 60px;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- chrome ------------------------------------------------------------ */
.top {
  display: flex; align-items: center; gap: 16px;
  padding: 14px var(--gutter);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: baseline; gap: 8px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-word {
  font-family: var(--serif);
  font-size: 19px; font-weight: 600; letter-spacing: -.01em;
}
.stage-pill {
  display: inline-block; margin-left: 12px; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: #7a3b00; background: #ffe7c2; border: 1px solid #f2c27a; align-self: center;
}
.brand-sub {
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}

.top-spacer { flex: 1; }

.who { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.who-name { color: var(--ink-2); }
.linkout {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
}
.linkout:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.linkout-off { border-color: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.signout {
  background: none; border: 0; padding: 4px; font: inherit; font-size: 12px;
  color: var(--ink-3); cursor: pointer; text-decoration: underline;
  text-underline-offset: 3px;
}
.signout:hover { color: var(--ink); }

/* Primary navigation. Five destinations, and never a sixth without a reason. */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--paper-2);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: var(--nav-h);
  font-size: 11px; letter-spacing: .02em; color: var(--ink-3);
  border-top: 2px solid transparent;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.nav-a:hover { text-decoration: none; color: var(--ink); background: rgba(15,92,115,.04); }
.nav-a svg { width: 20px; height: 20px; stroke: currentColor; fill: none;
             stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-on { color: var(--accent); border-top-color: var(--accent); }

.wrap { padding: clamp(20px, 4vw, 40px) var(--gutter) 48px; max-width: 1180px; margin: 0 auto; }

.foot {
  padding: 0 var(--gutter) 32px; color: var(--ink-3); font-size: 12px;
  max-width: 1180px; margin: 0 auto;
}

/* ---- page heading ------------------------------------------------------ */
.head {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.head-text { flex: 1 1 260px; min-width: 0; }
.eyebrow {
  font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 6px;
}
h1 {
  font-family: var(--serif);
  font-size: clamp(28px, 5.2vw, 42px);
  line-height: 1.1; letter-spacing: -.02em; font-weight: 600;
  margin: 0;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(19px, 2.6vw, 23px); line-height: 1.25; font-weight: 600;
  letter-spacing: -.01em; margin: 0 0 12px;
}
h3 { font-size: 14px; font-weight: 650; margin: 0 0 8px; letter-spacing: -.005em; }
.lede { color: var(--ink-2); margin: 8px 0 0; max-width: 62ch; }

/* ---- buttons ----------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-size: 14px; font-weight: 550; line-height: 1;
  padding: 11px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease,
              border-color .16s ease, color .16s ease;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: var(--shadow-2);
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2);
                     color: var(--accent-ink); box-shadow: var(--shadow-3); }
.btn-lg { padding: 14px 26px; font-size: 15px; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: rgba(23,32,42,.05); border-color: transparent; color: var(--ink); }
.btn-danger { color: var(--bad-ink); border-color: var(--bad-line); background: var(--bad-bg); }
.btn-danger:hover { border-color: var(--bad-ink); color: var(--bad-ink); }
.btn[disabled], .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; box-shadow: none; transform: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row-end { justify-content: flex-end; }

/* ---- surfaces ---------------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: clamp(16px, 2.6vw, 24px);
  box-shadow: var(--shadow-1);
}
.panel + .panel { margin-top: 16px; }
.panel-quiet { background: var(--paper-2); box-shadow: none; }
.panel-accent { border-color: var(--accent); box-shadow: var(--shadow-2); }

.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: clamp(20px, 3vw, 32px); }

/* The dashboard's four numbers. Deliberately not four identical cards: the
   first one is the one a user opens this page to see. */
.figures { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.figure {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow-1);
}
.figure-lead { grid-column: 1 / -1; background:
  linear-gradient(180deg, var(--surface) 0%, var(--accent-soft) 260%); }
.figure-n {
  font-family: var(--serif); font-size: clamp(30px, 7vw, 44px); line-height: 1;
  letter-spacing: -.03em; display: block; margin-bottom: 4px;
}
.figure-lead .figure-n { font-size: clamp(40px, 11vw, 62px); color: var(--accent); }
.figure-k { font-size: 12px; letter-spacing: .04em; color: var(--ink-2); }

/* ---- forms ------------------------------------------------------------- */
label { display: block; font-size: 13px; font-weight: 550; margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--ink-3); margin: 6px 0 0; }

input[type=text], input[type=url], input[type=email], input[type=password],
input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: 15px;
  padding: 10px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15,92,115,.14);
}
textarea { min-height: 170px; resize: vertical; line-height: 1.6; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.fields { display: grid; gap: 18px; grid-template-columns: 1fr; }

.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13.5px; cursor: pointer; user-select: none;
  transition: border-color .16s ease, background .16s ease, color .16s ease;
}
.check:hover { border-color: var(--accent); color: var(--accent); }
.check input { margin: 0; accent-color: var(--accent); }
.check:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
  font-weight: 550;
}

/* One choice out of a few, as cards rather than a select: the three ways of
   picking recipients are a real decision and deserve the room. */
.choices { display: grid; gap: 10px; }
.choice {
  display: block; border: 1px solid var(--line-2); border-radius: var(--r);
  padding: 14px 16px; background: var(--surface); cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.choice:hover { border-color: var(--accent); box-shadow: var(--shadow-1); }
.choice:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.choice-top { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.choice-top input { accent-color: var(--accent); }
.choice p { margin: 6px 0 0 24px; font-size: 13px; color: var(--ink-2); }
.choice-body { margin: 12px 0 0 24px; display: none; }
.choice:has(input:checked) .choice-body { display: block; }

/* ---- tables ------------------------------------------------------------ */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch;
                border: 1px solid var(--line); border-radius: var(--r);
                background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; white-space: nowrap;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  background: var(--paper-2); position: sticky; top: 0; z-index: 1;
}
thead th a { color: inherit; }
thead th a:hover { color: var(--accent); text-decoration: none; }
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: var(--paper-2); }
tbody tr:has(input[type=checkbox]:checked) { background: var(--accent-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.cell-name { font-weight: 600; }
.cell-sub { display: block; font-size: 12.5px; color: var(--ink-3); }
.cell-blank { color: var(--ink-3); opacity: .55; }
.col-pick { width: 34px; }
.col-pick input { accent-color: var(--accent); width: 16px; height: 16px; }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-2); }
.empty h2 { margin-bottom: 6px; }

/* ---- badges ------------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 600; letter-spacing: .02em; white-space: nowrap;
  border: 1px solid var(--mute-line); background: var(--mute-bg); color: var(--mute-ink);
}
.badge-ok    { background: var(--ok-bg);   color: var(--ok-ink);   border-color: var(--ok-line); }
.badge-warn  { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-line); }
.badge-bad   { background: var(--bad-bg);  color: var(--bad-ink);  border-color: var(--bad-line); }
.badge-cool  { background: var(--cool-bg); color: var(--cool-ink); border-color: var(--cool-line); }
.badge-live  { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.badge-live .dot { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.tag {
  display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0;
  border-radius: var(--r-pill); font-size: 11.5px;
  background: var(--paper); border: 1px solid var(--line-2); color: var(--ink-2);
}

/* ---- flashes ----------------------------------------------------------- */
.flashes { margin-bottom: 20px; display: grid; gap: 8px; }
.flash {
  margin: 0; padding: 11px 15px; border-radius: var(--r-sm); font-size: 14px;
  border: 1px solid var(--ok-line); background: var(--ok-bg); color: var(--ok-ink);
}
.flash-error, .flash-err { border-color: var(--bad-line); background: var(--bad-bg); color: var(--bad-ink); }

/* ---- the wizard -------------------------------------------------------- */
.steps {
  display: flex; gap: 6px; margin-bottom: 24px; overflow-x: auto;
  padding-bottom: 4px; -webkit-overflow-scrolling: touch;
}
.step {
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  padding: 6px 12px 6px 8px; border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--ink-3); border: 1px solid transparent;
}
.step-n {
  display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 20px;
  border-radius: 50%; background: var(--mute-bg); color: var(--mute-ink);
  font-size: 11px; font-weight: 700;
}
.step-done { color: var(--ink-2); }
.step-done .step-n { background: var(--ok-bg); color: var(--ok-ink); }
.step-now { color: var(--accent); border-color: var(--accent); background: var(--accent-soft);
            font-weight: 600; }
.step-now .step-n { background: var(--accent); color: var(--accent-ink); }
.step a { color: inherit; }

.count-live {
  font-family: var(--serif); font-size: clamp(24px, 5vw, 34px); line-height: 1.1;
  letter-spacing: -.02em; color: var(--accent);
}

/* The message, shown as a message. Not a code block, not a JSON blob. */
.note {
  background: var(--paper-2); border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm); padding: 16px 18px;
  white-space: pre-wrap; line-height: 1.65; font-size: 14.5px;
}
.note-title { font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
              color: var(--ink-3); margin: 0 0 8px; }

.switcher { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.switcher button {
  font: inherit; font-size: 13px; padding: 6px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  cursor: pointer; transition: all .16s ease;
}
.switcher button:hover { border-color: var(--accent); color: var(--accent); }
.switcher button[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  font-weight: 550;
}

/* ---- progress (find contacts) ------------------------------------------ */
.progress { display: grid; gap: 14px; }
.progress-line { display: flex; align-items: center; gap: 12px; font-size: 15px;
                 color: var(--ink-3); }
.progress-line.on { color: var(--ink); font-weight: 550; }
.progress-line.past { color: var(--ink-2); }
.spinner {
  width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%;
  border: 2px solid var(--line-2); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-line.past .spinner { border: 0; background: var(--ok-ink);
  -webkit-mask: var(--tick) center/12px no-repeat; mask: var(--tick) center/12px no-repeat;
  animation: none; }
.progress-line:not(.on):not(.past) .spinner { border-color: var(--line); border-top-color: var(--line);
  animation: none; }
:root { --tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5l3.5 3.5L13 5' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; }
}

/* ---- the sticky action bar --------------------------------------------- */
/* One primary action per page, and it stays reachable while a long list
   scrolls past it. */
.actionbar {
  position: sticky; bottom: calc(var(--nav-h) + 8px); z-index: 20;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 20px; padding: 12px 14px;
  background: rgba(253,252,250,.94);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-2);
}
.actionbar .grow { flex: 1; font-size: 13.5px; color: var(--ink-2); min-width: 140px; }

/* ---- sign in ----------------------------------------------------------- */
.signin { max-width: 380px; margin: clamp(40px, 12vh, 110px) auto; padding: 0 20px; }

/* ---- viewer (LinkedIn sign-in) ----------------------------------------- */
.viewer {
  width: 100%; height: min(76vh, 780px); border: 1px solid var(--line-2);
  border-radius: var(--r); background: #fff; display: block;
}

/* ---- wider screens ----------------------------------------------------- */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .nav {
    position: static; display: flex; gap: 4px;
    border-top: 0; background: none; padding: 0;
  }
  .nav-a {
    flex-direction: row; gap: 7px; height: auto; padding: 8px 13px;
    font-size: 14px; border-top: 0; border-radius: var(--r-pill);
  }
  .nav-a svg { width: 17px; height: 17px; }
  .nav-on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .nav-on:hover { background: var(--accent-soft); }
  .figures { grid-template-columns: repeat(4, 1fr); }
  .figure-lead { grid-column: auto; }
  .fields-2 { grid-template-columns: 1fr 1fr; }
  .fields-3 { grid-template-columns: repeat(3, 1fr); }
  .actionbar { bottom: 12px; }
  .split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
           gap: clamp(20px, 3vw, 32px); align-items: start; }
}

@media (max-width: 759px) {
  .top { padding: 12px 16px; }
  .brand-sub, .who-name { display: none; }
  thead th, tbody td { padding: 10px 12px; }
}
