/* Program1 X Outreach
   Layout idea: night navy chrome around a cream working surface.
   Phone gets a bottom tab bar, desktop gets a left rail.
   One bold element: the send strip on Activity. */

:root {
  --night: #0B132B;
  --night-2: #16203F;
  --blue: #1565FF;
  --blue-deep: #0E4BD0;
  --blue-soft: #E4ECFF;
  --cream: #F5F5F0;
  --paper: #FFFFFF;
  --ink: #0B132B;
  --muted: #5A6278;
  --line: #DCDCD2;
  --good: #0F7A55;
  --good-soft: #DDF3EA;
  --warn: #A65A00;
  --warn-soft: #FCEBD0;
  --bad: #B3261E;
  --bad-soft: #FBE1DF;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Barlow", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 10px;
  --tab-h: 62px;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue-deep);
}

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

.view:focus {
  outline: none;
}

[hidden] {
  display: none !important;
}

/* ---------- Shell ---------- */

.shell {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--night);
  color: var(--cream);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cream);
  text-decoration: none;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--night-2);
}

.mark-svg {
  display: block;
  height: 24px;
  width: auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-sub {
  font-size: 14px;
  color: #B9C2DC;
}

.brand-compact .brand-sub {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  color: var(--cream);
}

.proto-pill {
  padding: 4px 10px;
  border: 1px solid #3A4670;
  border-radius: 999px;
  font-size: 12px;
  color: #C9D1E8;
  white-space: nowrap;
}

.rail {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--night);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.rail > .brand,
.rail-note {
  display: none;
}

.nav {
  display: flex;
  height: var(--tab-h);
}

.nav a {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #AEB8D4;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.nav svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.800;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav a[aria-current="page"] {
  color: var(--paper);
}

.nav a[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22%;
  right: 22%;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--blue);
}

.nav-badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 8px);
  min-width: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--blue);
  color: var(--paper);
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--tab-h) + 96px);
}

/* ---------- Type ---------- */

.h1 {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: balance;
}

.h2 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.15;
}

.lede {
  max-width: 60ch;
  color: var(--muted);
}

.small {
  font-size: 14px;
  color: var(--muted);
}

.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* ---------- Page head ---------- */

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 18px;
}

.page-head > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  border-color: #B9B9AC;
}

.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: var(--paper);
}

.btn-primary:hover {
  border-color: var(--blue-deep);
  background: var(--blue-deep);
}

.btn-danger {
  border-color: var(--bad);
  color: var(--bad);
}

.btn-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--blue-deep);
  padding: 0 10px;
}

.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

/* ---------- Panels and rows ---------- */

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.panel-pad {
  padding: 16px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.group-list {
  display: flex;
  flex-direction: column;
}

.group-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.group-row:last-child {
  border-bottom: 0;
}

.group-row:hover {
  background: #FAFAF6;
}

.group-name {
  font-family: var(--display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.group-count {
  grid-row: span 2;
  text-align: right;
  line-height: 1;
}

.group-count .num {
  display: block;
  font-size: 34px;
}

.group-count span {
  font-size: 13px;
  color: var(--muted);
}

.reach {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
}

.reach-bar {
  flex: 0 0 72px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}

.reach-bar i {
  display: block;
  height: 100%;
  background: var(--good);
}

.callout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--night);
  color: var(--cream);
}

.callout p {
  color: #C9D1E8;
  font-size: 15px;
}

.callout .h2 {
  margin-bottom: 4px;
  color: var(--paper);
}

.callout-x {
  flex: 0 0 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  color: var(--paper);
}

/* ---------- Filters ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.search {
  flex: 1 1 220px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: 500;
}

.chip[aria-pressed="true"] {
  border-color: var(--night);
  background: var(--night);
  color: var(--paper);
}

/* ---------- Recruit rows ---------- */

.recruit {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 2px 12px;
  width: 100%;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.recruit:last-child {
  border-bottom: 0;
}

button.recruit:hover {
  background: #FAFAF6;
}

.avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recruit-name {
  grid-column: 2;
  grid-row: 1;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.recruit-name span {
  margin-left: 6px;
  font-weight: 400;
  color: var(--muted);
}

.recruit-meta {
  grid-column: 2;
  grid-row: 2;
  font-size: 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.recruit .pill {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pill-good {
  background: var(--good-soft);
  color: var(--good);
}

.pill-bad {
  background: var(--bad-soft);
  color: var(--bad);
}

.pill-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-mute {
  background: #ECECE4;
  color: var(--muted);
}

.pill-blue {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.empty .h2 {
  margin-bottom: 6px;
  color: var(--ink);
}

.empty .btn {
  margin-top: 14px;
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label,
.label {
  font-size: 14px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #C4C4B8;
  border-radius: 8px;
  background: var(--paper);
}

.field textarea {
  min-height: 170px;
  resize: vertical;
  line-height: 1.5;
}

.field input[readonly] {
  background: #F0F0EA;
  color: var(--muted);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.hint {
  font-size: 13px;
  color: var(--muted);
}

.checks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--blue);
}

/* ---------- Compose ---------- */

.compose {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.merge {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.merge button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px dashed #9DB4F2;
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 14px;
  font-weight: 500;
}

.merge button:hover {
  border-style: solid;
}

.compose-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.audience {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 14px;
}

.audience b {
  font-family: var(--display);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.stepper {
  flex: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.stepper button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font-size: 18px;
  line-height: 1;
}

.dm {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--night);
}

.dm-to {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--cream);
  font-weight: 600;
}

.dm-to span {
  font-weight: 400;
  color: #AEB8D4;
}

.dm-to .avatar {
  width: 36px;
  height: 36px;
  font-size: 15px;
}

.bubble {
  max-width: 34ch;
  margin-left: auto;
  padding: 12px 14px;
  border-radius: 18px 18px 4px 18px;
  background: var(--blue);
  color: var(--paper);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble mark {
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

.bubble .miss {
  background: var(--bad);
  color: var(--paper);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 13px;
}

.bubble-empty {
  background: var(--night-2);
  color: #AEB8D4;
}

.notice {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--warn-soft);
  color: #6B3A00;
  font-size: 14px;
}

.notice-info {
  background: var(--blue-soft);
  color: #0B3391;
}

.sendbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

.sendbar .small {
  line-height: 1.25;
}

.sendbar .btn {
  flex: none;
  white-space: nowrap;
}

/* ---------- Activity ---------- */

.campaign {
  padding: 16px;
}

.campaign + .campaign {
  border-top: 1px solid var(--line);
}

.campaign-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 6px;
}

.score {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 10px 0;
}

.score .num {
  font-size: 54px;
  line-height: 0.95;
}

.score span {
  color: var(--muted);
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0;
}

.strip i {
  width: 14px;
  height: 14px;
  border: 1.500px solid #B9C2DC;
  border-radius: 3px;
  background: transparent;
}

.strip i.sent {
  border-color: var(--blue);
  background: var(--blue);
}

.strip i.skipped {
  border-color: #C4C4B8;
  background: repeating-linear-gradient(135deg, #C4C4B8 0 2px, transparent 2px 5px);
}

.strip i.failed {
  border-color: var(--bad);
  background: var(--bad);
}

.strip i.next {
  border-color: var(--blue);
  animation: pulse 0.900s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    background: var(--blue-soft);
    transform: scale(1.180);
  }
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend .strip-key {
  width: 12px;
  height: 12px;
  border: 1.500px solid #B9C2DC;
  border-radius: 3px;
}

.legend .strip-key.sent {
  border-color: var(--blue);
  background: var(--blue);
}

.legend .strip-key.skipped {
  border-color: #C4C4B8;
  background: repeating-linear-gradient(135deg, #C4C4B8 0 2px, transparent 2px 5px);
}

.legend .strip-key.failed {
  border-color: var(--bad);
  background: var(--bad);
}

.quote {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-left: 3px solid var(--blue);
  background: #F7F8FC;
  font-size: 15px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.campaign-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.item-list {
  margin-top: 12px;
  border-top: 1px solid var(--line);
}

.item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #ECECE4;
  font-size: 15px;
}

.item:last-child {
  border-bottom: 0;
}

.item span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ---------- Setup ---------- */

.setup-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
}

.steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ---------- Sheet ---------- */

.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(11, 19, 43, 0.550);
  animation: fade 0.150s ease-out;
}

.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 92%;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  background: var(--paper);
  animation: rise 0.220s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 8px;
}

.sheet-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #ECECE4;
  font-size: 20px;
  line-height: 1;
}

.sheet-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 16px 16px;
  overflow-y: auto;
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
}

.sheet-foot .btn-primary {
  flex: 1;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}

/* ---------- Toasts ---------- */

.toasts {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(var(--tab-h) + 84px);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--night);
  color: var(--paper);
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(11, 19, 43, 0.280);
  animation: rise 0.220s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Desktop ---------- */

@media (min-width: 900px) {
  .shell {
    flex-direction: row;
  }

  .rail {
    position: sticky;
    top: 0;
    flex: 0 0 232px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: 22px 14px;
  }

  .rail > .brand {
    display: flex;
    padding: 0 8px;
  }

  .rail-note {
    display: block;
    margin-top: auto;
    padding: 0 8px;
    font-size: 13px;
    color: #8F9ABB;
  }

  .nav {
    flex-direction: column;
    height: auto;
    gap: 4px;
  }

  .nav a {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 16px;
  }

  .nav a:hover {
    background: var(--night-2);
    color: var(--paper);
  }

  .nav a[aria-current="page"] {
    background: var(--night-2);
  }

  .nav a[aria-current="page"]::before {
    top: 10px;
    bottom: 10px;
    left: 0;
    right: auto;
    width: 3px;
    height: auto;
    border-radius: 0 3px 3px 0;
  }

  .nav-badge {
    position: static;
    margin-left: auto;
  }

  .topbar {
    display: none;
  }

  .view {
    padding: 36px 32px 120px;
  }

  .h1 {
    font-size: 44px;
  }

  .compose {
    grid-template-columns: minmax(0, 1.150fr) minmax(0, 0.850fr);
    align-items: start;
  }

  .compose-side {
    position: sticky;
    top: 24px;
  }

  .sendbar {
    left: 232px;
    bottom: 0;
    padding: 14px 32px;
  }

  .scrim {
    align-items: center;
  }

  .sheet {
    border-radius: 16px;
  }

  .toasts {
    left: 232px;
    bottom: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
