/* WSMM Networking Engine -- brand system.
   Palette is locked to WSMM brand: Dark Azure ink, Teal action, Azure wash.
   Tints are alphas of existing colors, never new hexes. */
:root {
  --ink: #003262;        /* Dark Azure -- headers, primary text */
  --teal: #3EB5B5;       /* brand action color */
  --wash: #F4FBFF;       /* Light Azure page background */
  --paper: #FFFFFF;
  --grey: #737373;
  --line: #F3F3F3;
  --urgent: #14110F;     /* near-black -- overdue/urgent chips */
  --teal-10: rgba(62, 181, 181, 0.10);
  --teal-18: rgba(62, 181, 181, 0.18);
  --ink-06: rgba(0, 50, 98, 0.06);
  --ink-40: rgba(0, 50, 98, 0.40);
  --display: "Fraunces", Georgia, serif;
  --body: "Poppins", -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; }
[hidden] { display: none !important; }
html { font-size: 15px; }
body {
  font-family: var(--body);
  background: var(--wash);
  color: var(--ink);
  min-height: 100vh;
}
a { color: var(--ink); }
button { font-family: var(--body); cursor: pointer; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.wordmark {
  font-family: var(--display); font-weight: 700; font-size: 1.15rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.wordmark .tick { color: var(--teal); }
.topbar .spacer { flex: 1; }
.topbar .nav a {
  font-size: 0.8rem; color: var(--grey); text-decoration: none; margin-left: 1.1rem;
}
.topbar .nav a:hover { color: var(--ink); }

/* ---------- today strip ---------- */
.today {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem;
  padding: 1.25rem 1.5rem 0.5rem; max-width: 1200px; margin: 0 auto;
}
.today h1 {
  grid-column: 1 / -1;
  font-family: var(--display); font-weight: 600; font-size: 1.7rem;
  letter-spacing: -0.02em; padding-bottom: 0.35rem;
}
.focus-card {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 1.5rem;
  justify-content: space-between; padding: 1rem 1.15rem; border-radius: 10px;
  background: var(--ink); color: var(--paper);
}
.focus-copy { min-width: 0; }
.focus-kicker {
  color: var(--teal); font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em; margin-bottom: 0.25rem;
}
.focus-card h2 { font-family: var(--display); font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.focus-card p { margin-top: 0.25rem; color: var(--wash); font-size: 0.78rem; }
.focus-card .btn { flex: 0 0 auto; }
.tile {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.8rem 1rem; text-align: left; transition: border-color 120ms;
}
.tile:hover, .tile.active { border-color: var(--teal); }
.tile .num { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }
.tile .lbl { font-size: 0.72rem; color: var(--grey); text-transform: uppercase; letter-spacing: 0.06em; }
.tile.replies .num { color: var(--teal); }

/* ---------- grid ---------- */
.gridwrap { max-width: 1200px; margin: 0.75rem auto 4rem; padding: 0 1.5rem; }
.gridtools { display: flex; gap: 0.6rem; align-items: center; margin-bottom: 0.6rem; flex-wrap: wrap; }
.gridtools .spacer { flex: 1; }
table.grid {
  width: 100%; border-collapse: collapse; background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.grid th {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--grey); font-weight: 600; text-align: left;
  padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.grid td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tr.row { cursor: pointer; }
.grid tr.row:hover td { background: var(--wash); }
.grid tr.no-results td { padding: 2rem 1rem; color: var(--grey); text-align: center; font-size: 0.8rem; }
.grid .who .nm { font-weight: 600; font-size: 0.92rem; }
.grid .who .fm { font-size: 0.78rem; color: var(--grey); }
.view-link {
  border: 0; padding: 0; background: transparent; color: var(--grey);
  font-family: var(--body); font-size: 0.66rem; text-decoration: underline;
  text-underline-offset: 2px;
}
.view-link:hover { color: var(--ink); }
.grid .email { font-family: var(--mono); font-size: 0.78rem; }
.muted-small { color: var(--grey); font-size: 0.76rem; }

/* cadence rail -- the doctrine as five segments */
.rail { display: flex; gap: 3px; }
.rail i {
  width: 16px; height: 6px; border-radius: 3px;
  background: var(--ink-06); border: 1px solid var(--ink-06);
}
.rail i.done { background: var(--teal); border-color: var(--teal); }
.rail i.due { background: var(--urgent); border-color: var(--urgent); }
.rail i.replied { background: var(--ink); border-color: var(--ink); }

/* chips */
.chip {
  display: inline-block; max-width: 11rem; font-size: 0.68rem; font-weight: 600;
  padding: 0.18rem 0.55rem; border-radius: 999px; letter-spacing: 0.03em;
  line-height: 1.25; white-space: nowrap;
}
.chip.tier-warm      { background: var(--teal-18); }
.chip.tier-alumni    { background: var(--teal-10); }
.chip.tier-connected { background: var(--ink-06); }
.chip.tier-cold      { background: var(--line); color: var(--grey); }
.chip.st-replied     { background: var(--teal); color: #fff; }
.chip.st-call_booked { background: var(--ink); color: #fff; }
.chip.st-drafted     { background: var(--teal-10); }
.chip.st-researched  { background: var(--teal-10); }
.chip.st-sent        { background: var(--ink-06); }
.chip.st-queued      { background: var(--line); color: var(--grey); }
.chip.st-closed, .chip.st-dnc { background: var(--line); color: var(--grey); }
.chip.overdue        { background: var(--urgent); color: #fff; }
.chip.conf-verified   { background: var(--teal-18); }
.chip.conf-convention { background: var(--ink-06); }
.chip.conf-unverified { background: var(--urgent); color: #fff; }

/* buttons */
.btn {
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
  border-radius: 7px; padding: 0.42rem 0.9rem; font-size: 0.8rem; font-weight: 600;
}
.btn:hover { background: var(--ink-06); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.primary:hover { filter: brightness(0.95); }
.btn.quiet { border-color: var(--line); color: var(--grey); }
.btn.small { padding: 0.28rem 0.6rem; font-size: 0.72rem; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* detail drawer row */
tr.detail td { background: var(--wash); padding: 1rem 1.4rem; }
.draftbox {
  background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.9rem 1rem; font-family: var(--mono); font-size: 0.8rem;
  white-space: pre-wrap; max-width: 46rem;
}
.draftbox + .draftbox { margin-top: 0.6rem; }
.detail .meta { font-size: 0.78rem; color: var(--grey); margin: 0.5rem 0; }
.detail .actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.pre-draft {
  display: grid; gap: 0.25rem; max-width: 46rem; margin-bottom: 0.8rem;
  padding: 0.8rem 0.9rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--paper); font-size: 0.78rem;
}
.pre-draft span { color: var(--grey); }
.pre-draft a { width: fit-content; font-size: 0.72rem; }
.hook-note, .email-warning {
  display: grid; gap: 0.2rem; max-width: 46rem; margin-bottom: 0.8rem;
  border-radius: 8px; padding: 0.75rem 0.9rem; font-size: 0.78rem;
}
.hook-note { background: var(--paper); border-left: 3px solid var(--teal); }
.hook-note span, .hook-note small { color: var(--grey); }
.email-warning { background: var(--paper); border: 1px solid var(--ink-40); }
.email-warning span { color: var(--grey); }
.draft-card {
  max-width: 50rem; margin-top: 0.8rem; padding: 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.draft-head { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 0.75rem; }
.draft-head strong { font-family: var(--display); font-size: 1rem; }
.draft-head span, .subject-line > span, .variant-label {
  color: var(--grey); font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em;
}
.subject-line {
  display: grid; grid-template-columns: 4.25rem minmax(0, 1fr); align-items: start;
  gap: 0.5rem; padding: 0.65rem 0; border-top: 1px solid var(--line);
}
.subject-line code { color: var(--ink); font-family: var(--mono); font-size: 0.8rem; overflow-wrap: anywhere; }
.draft-card .draftbox { border-color: var(--ink-06); background: var(--wash); }
.copy-actions { display: flex; justify-content: flex-end; gap: 0.45rem; margin-top: 0.55rem; flex-wrap: wrap; }
.variant-label { margin: 1rem 0 0.45rem; }

/* ---------- toast / errors ---------- */
#toast {
  position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 0.7rem 1.2rem; border-radius: 9px;
  font-size: 0.85rem; opacity: 0; pointer-events: none; transition: opacity 180ms;
  max-width: 90vw; z-index: 50;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--urgent); }

/* ---------- auth + onboarding ---------- */
.split { display: flex; min-height: 100vh; }
.split .brandside {
  flex: 1; background: var(--teal); color: #fff; padding: 3.5rem;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.brandside h2 {
  font-family: var(--display); font-weight: 600; font-size: 2.3rem;
  line-height: 1.15; letter-spacing: -0.02em; max-width: 22ch;
}
.brandside p { margin-top: 1rem; color: #F4FBFF; font-size: 0.9rem; max-width: 44ch; }
.split .formside {
  width: min(460px, 100%); background: var(--paper); padding: 3.5rem 3rem;
  display: flex; flex-direction: column; justify-content: center;
}
.formside h1 { font-family: var(--display); font-size: 1.5rem; margin-bottom: 1.4rem; }
.form-error {
  margin: -0.55rem 0 1rem; padding: 0.7rem 0.8rem; border-left: 3px solid var(--urgent);
  border-radius: 0 7px 7px 0; background: var(--ink-06); color: var(--ink);
  font-size: 0.76rem; line-height: 1.45;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.75rem; font-weight: 600; margin-bottom: 0.3rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.55rem 0.7rem; border: 1px solid var(--line); border-radius: 7px;
  font-family: var(--body); font-size: 0.88rem; background: var(--wash); color: var(--ink);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 0.72rem; color: var(--grey); margin-top: 0.25rem; }
.digest-choice { display: inline-flex; align-items: center; gap: 0.65rem; font-weight: 600; cursor: pointer; }
.digest-choice input { width: 1.1rem; height: 1.1rem; accent-color: var(--teal); }
.required {
  margin-left: 0.3rem; color: var(--grey); font-size: 0.62rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.wizard { max-width: 620px; margin: 3rem auto; background: var(--paper);
  border: 1px solid var(--line); border-radius: 12px; padding: 2.2rem 2.5rem; }
.wizard h1 { font-family: var(--display); font-size: 1.6rem; margin-bottom: 0.3rem; }
.wizard .sub { color: var(--grey); font-size: 0.85rem; margin-bottom: 1.5rem; }
.steps { display: flex; gap: 5px; margin-bottom: 0.45rem; }
.steps i { flex: 1; height: 5px; border-radius: 3px; background: var(--ink-06); }
.steps i.on { background: var(--teal); }
.step-labels {
  display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 1.55rem;
  color: var(--grey); font-size: 0.62rem; text-align: center;
}
.step-labels span:first-child { text-align: left; }
.step-labels span:last-child { text-align: right; }
.step-labels span.on { color: var(--ink); font-weight: 600; }
.step-labels.two { grid-template-columns: repeat(2, 1fr); }
.step-kicker, .empty-kicker {
  margin-bottom: 0.35rem; color: var(--teal); font-size: 0.67rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
}
.wizard .nav { display: flex; justify-content: space-between; margin-top: 1.6rem; }
.compact-wizard { max-width: 580px; margin: 1.5rem auto; padding: 1.55rem 2.5rem; }
.compact-wizard .field { margin-bottom: 0.8rem; }
.compact-wizard .field textarea { min-height: 80px; }
.wizard-footer { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.wizard-footer .nav { margin-top: 0.6rem; }
.wizard-footer > p { margin-top: 0.7rem; color: var(--grey); font-size: 0.7rem; }
.save-state { min-height: 1rem; color: var(--grey); font-size: 0.68rem; }
.timing-note {
  background: var(--teal-10); border-left: 3px solid var(--teal);
  padding: 0.8rem 1rem; font-size: 0.85rem; border-radius: 0 8px 8px 0; margin-top: 1rem;
}

/* settings */
.panel { max-width: 720px; margin: 2rem auto; padding: 0 1.5rem; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.3rem 1.5rem; margin-bottom: 1rem; }
.card h3 { font-family: var(--display); font-size: 1.05rem; margin-bottom: 0.5rem; }
.card p { font-size: 0.83rem; color: var(--grey); margin-bottom: 0.7rem; }
.kv { font-family: var(--mono); font-size: 0.8rem; }
.settings-details { margin-top: 0.8rem; }
.settings-details summary { cursor: pointer; font-size: 0.8rem; font-weight: 600; }
.settings-form {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem;
  margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line);
}
.settings-form .full { grid-column: 1 / -1; }
.setup-list { border-top: 1px solid var(--line); }
.setup-row {
  display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: 0.65rem;
  align-items: center; padding: 0.75rem 0; border-bottom: 1px solid var(--line);
}
.setup-row:last-child { border-bottom: 0; }
.setup-row > div { display: grid; gap: 0.05rem; }
.setup-row strong { font-size: 0.78rem; }
.setup-row small { color: var(--grey); font-size: 0.68rem; }
.setup-mark {
  display: grid; place-items: center; width: 1.55rem; height: 1.55rem;
  border-radius: 50%; background: var(--ink-06); color: var(--grey); font-weight: 700;
}
.setup-mark.ready { background: var(--teal-18); color: var(--ink); }
.status-link {
  border: 0; background: transparent; color: var(--ink); padding: 0;
  font-family: var(--body); font-size: 0.7rem; font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px;
}
.pair-code {
  max-width: 22rem; margin: 0.8rem 0; padding: 0.9rem 1rem; border-radius: 8px;
  background: var(--wash); border: 1px solid var(--line); font-family: var(--mono);
  font-size: 1.45rem; font-weight: 700; letter-spacing: 0.2em; text-align: center;
}
.plain-steps { margin: 0.7rem 0 0.8rem 1.15rem; padding: 0; }
.plain-steps li { margin-bottom: 0.45rem; padding-left: 0.2rem; color: var(--grey); font-size: 0.8rem; }

.empty {
  text-align: center; padding: 3.25rem 1.5rem; color: var(--grey);
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.empty h3 { font-family: var(--display); color: var(--ink); font-size: 1.3rem; margin-bottom: 0.4rem; }
.empty > p { max-width: 46rem; margin: 0 auto; font-size: 0.82rem; }
.first-path {
  display: grid; grid-template-columns: minmax(0, 1fr) 2.25rem minmax(0, 1fr) 2.25rem minmax(0, 1fr);
  align-items: center; max-width: 48rem; margin: 1.7rem auto;
}
.path-step { display: grid; justify-items: center; gap: 0.3rem; }
.path-step span {
  display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%;
  background: var(--teal); color: var(--paper); font-family: var(--mono); font-weight: 700;
}
.path-step strong { color: var(--ink); font-size: 0.82rem; }
.path-step small { max-width: 13rem; font-size: 0.7rem; line-height: 1.4; }
.path-line { height: 1px; background: var(--teal-18); }
.empty .send-note { margin-top: 0.75rem; font-size: 0.7rem; }
.empty-actions { display: flex; justify-content: center; gap: 0.55rem; flex-wrap: wrap; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; align-items: center; justify-content: center;
  padding: 1rem; background: rgba(0,50,98,0.35);
}

@media (max-width: 760px) {
  .split .brandside { display: none; }
  .topbar {
    align-items: flex-start; flex-wrap: wrap; gap: 0.55rem;
    padding: 0.75rem 1rem;
  }
  .topbar .spacer { display: none; }
  .topbar .nav {
    display: flex; gap: 0.9rem; width: 100%; overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar .nav::-webkit-scrollbar { display: none; }
  .topbar .nav a { margin-left: 0; white-space: nowrap; }

  .today {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 1rem 1rem 0.4rem;
  }
  .today h1 { font-size: 1.45rem; }
  .tile { min-width: 0; padding: 0.7rem 0.75rem; }
  .tile .lbl { font-size: 0.64rem; line-height: 1.25; }
  .focus-card { align-items: flex-start; gap: 0.85rem; }

  .gridwrap { margin-top: 0.6rem; padding: 0 1rem; }
  .gridtools .spacer { display: none; }
  .gridtools > a.btn.quiet { order: 3; width: 100%; text-align: center; }

  table.grid, .grid tbody { display: block; width: 100%; }
  .grid thead { display: none; }
  .grid tr.row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem 0.8rem; padding: 0.9rem;
    border-bottom: 1px solid var(--line);
  }
  .grid tr.row:hover td { background: transparent; }
  .grid tr.row td { padding: 0; border: 0; min-width: 0; }
  .grid .hide-m { display: none; }
  .grid tr.row td:nth-child(4) { grid-column: 1; }
  .grid tr.row td:nth-child(5) { grid-column: 2; grid-row: 1; }
  .grid tr.row td:nth-child(6) { grid-column: 1 / -1; }
  .grid tr.row td:nth-child(7) { grid-column: 1 / -1; }
  .grid tr.row td:nth-child(7) .btn { width: 100%; }

  .grid tr.detail, .grid tr.detail td { display: block; width: 100%; }
  .grid tr.detail td { padding: 0.9rem; }
  .draftbox { max-width: 100%; overflow-wrap: anywhere; font-size: 0.74rem; }
  .draft-card { padding: 0.8rem; }
  .draft-head { align-items: flex-start; }
  .copy-actions .btn { flex: 1; }

  #add-modal .wizard {
    max-height: calc(100vh - 2rem); overflow-y: auto;
    margin: 1rem; padding: 1.35rem;
  }
  .settings-form { grid-template-columns: 1fr; }
  .settings-form .full { grid-column: auto; }
}
@media (max-width: 520px) {
  .today { grid-template-columns: 1fr; }
  .tile {
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    align-items: center; gap: 0.7rem;
  }
  .tile .num { font-size: 1.3rem; }
  .focus-card { display: grid; }
  .focus-card .btn { width: 100%; }
  .first-path { grid-template-columns: 1fr; gap: 0.7rem; margin: 1.35rem auto; }
  .path-line { width: 1px; height: 1.1rem; justify-self: center; }
  .empty { padding: 2.25rem 1rem; }
  .wizard { margin: 1rem; padding: 1.4rem 1.2rem; }
  .compact-wizard { margin: 1rem; padding: 1.4rem 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
