/* Page 3 - Marketing. Only what the shared parts in app.css do not give: the strategy as a
   plain document, the calendar (a month grid on laptops, a list grouped by day on phones,
   one set of elements), the link cell of the assets table and the plain lines inside the
   sheets. Every class here starts with mkt-. Colours and sizes come from the tokens. */

/* ---------- Text someone typed: line breaks kept, never HTML ---------- */

.mkt-prose {
  max-width: 68ch;
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mkt-prose--after {
  margin-top: 12px;
}

/* A quiet line under the tabs (the strategy is not searched). */
.mkt-note {
  margin: 0;
  padding: 12px 0 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
}

/* ---------- Strategy: a plain document ---------- */

.mkt-doc {
  display: flex;
  flex-direction: column;
  gap: 28px;
  max-width: 760px;
  padding: 24px 0 28px;
}

.mkt-doc__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-bottom: 4px;
}

.mkt-doc__title {
  margin: 0;
  font-size: 15px;
  line-height: 20px;
  font-weight: 600;
}

.mkt-doc__prompt {
  max-width: 68ch;
  margin: 0;
  color: var(--ink-3);
}

/* ---------- Campaigns ---------- */

/* " per lead" after the cost on a phone row; the column heading says it on laptops. */
.mkt-phone-unit {
  display: none;
}

/* ---------- Calendar: the month stepper ---------- */

.mkt-month {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mkt-month__label {
  min-width: 9.5em;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------- Calendar: the days ---------- */

.mkt-cal {
  padding: 0 0 28px;
}

.mkt-cal__days {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mkt-day__head {
  margin: 0;
  font-size: 13px;
  line-height: 18px;
  font-weight: 600;
}

.mkt-day__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.mkt-entry {
  position: relative;
  min-width: 0;
}

.mkt-entry__open {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mkt-entry__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-glyph {
  flex: none;
  color: var(--ink-3);
}

.mkt-entry--late .mkt-entry__title,
.mkt-entry--late .mkt-glyph {
  color: var(--late);
}

.mkt-entry--done .mkt-entry__title {
  color: var(--ink-3);
}

.mkt-entry__sub {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
}

.mkt-entry__where {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-day__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
}

/* Laptops: a month grid with thin lines; each item is one line. */
@media (min-width: 900px) {
  .mkt-cal {
    padding-top: 0;
  }

  .mkt-cal__weekdays,
  .mkt-cal__days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .mkt-cal__weekdays {
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: var(--r-box) var(--r-box) 0 0;
    background: var(--panel);
  }

  .mkt-cal__weekdays span {
    padding: 10px 12px;
    font-size: 12px;
    line-height: 16px;
    font-weight: 500;
    color: var(--ink-3);
  }

  .mkt-cal__days {
    grid-auto-rows: minmax(112px, auto);
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 0 0 var(--r-box) var(--r-box);
    overflow: hidden;
  }

  .mkt-day {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding: 8px 8px 10px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .mkt-day__head {
    display: flex;
    align-items: center;
    height: 24px;
    padding-left: 4px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }

  .mkt-day--out .mkt-day__head {
    color: var(--ink-3);
    font-weight: 400;
  }

  /* Today: the number in the accent, as a small filled circle. */
  .mkt-day--today .mkt-day__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    margin-left: -4px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 600;
  }

  /* The full date and the word "Today" are for screen readers only on the grid. */
  .mkt-day__full,
  .mkt-day__today,
  .mkt-entry__sub,
  .mkt-entry__late {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .mkt-day__add {
    position: absolute;
    top: 8px;
    right: 8px;
    opacity: 0;
  }

  .mkt-day:hover .mkt-day__add,
  .mkt-day__add:focus-visible {
    opacity: 1;
  }

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

  .mkt-entry__open {
    min-height: 24px;
    padding: 2px 4px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 18px;
  }

  .mkt-day--out .mkt-entry__open {
    color: var(--ink-3);
  }

  .mkt-cal__none {
    display: none;
  }
}

/* Phones: the days that have something, each a grey heading with two-line rows under it. */
@media (max-width: 899.98px) {
  .mkt-cal {
    margin: 0 calc(-1 * var(--gutter));
    padding: 0 0 16px;
    border-top: 1px solid var(--line-soft);
  }

  .mkt-cal__weekdays,
  .mkt-day--out,
  .mkt-day--empty,
  .mkt-day__num,
  .mkt-day__add {
    display: none;
  }

  .mkt-day__head {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 16px;
    background: var(--panel);
  }

  .mkt-day__today {
    font-weight: 400;
    color: var(--ink-3);
  }

  .mkt-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "open open"
      "sub late";
    align-content: center;
    column-gap: 12px;
    row-gap: 4px;
    box-sizing: border-box;
    min-height: 65px;
    padding: 0 16px;
    border-bottom: 1px solid var(--line-soft);
  }

  .mkt-entry__open {
    grid-area: open;
    font-size: 15px;
    line-height: 20px;
    font-weight: 500;
  }

  /* The whole row opens the item. */
  .mkt-entry__open::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  .mkt-entry__open .mkt-glyph {
    display: none;
  }

  .mkt-entry__sub {
    grid-area: sub;
  }

  .mkt-entry__late {
    grid-area: late;
    align-self: center;
  }

  .mkt-cal__none {
    padding: 8px 16px;
  }

  .mkt-phone-unit {
    display: inline;
  }
}

/* ---------- Assets: the link cell ---------- */

.mkt-link {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mkt-link__text {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: all;
}

.mkt-link__acts {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.mkt-link--compact .mkt-link__text {
  overflow: hidden;
  color: var(--ink-3);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mkt-link__none {
  color: var(--ink-3);
}

/* A row's Open and Copy: small and quiet, so the table stays calm. */
.mkt-link--compact .btn--small {
  min-height: 28px;
  height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

/* On a phone the row shows the address only; Open and Copy are in the asset's sheet. */
@media (max-width: 899.98px) {
  .mkt-link--compact .mkt-link__acts {
    display: none;
  }
}

/* The campaign select in the filter row: as tall as a chip. */
.mkt-pick {
  width: auto;
  max-width: 14rem;
  min-height: 32px;
  height: 32px;
  padding: 0 28px 0 10px;
  font-size: 13px;
}

@media (max-width: 899.98px) {
  .mkt-pick {
    height: 44px;
    min-height: 44px;
    font-size: 16px;
  }
}

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

/* Two fields side by side keep their inputs level when only one of them has a hint. */
.mkt-form .form__row {
  align-items: start;
}

/* ---------- Inside the sheets: plain lines ---------- */

.mkt-count {
  font-weight: 400;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.mkt-lines {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.mkt-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  min-height: 44px;
  padding: 8px 0;
  border-top: 1px solid var(--line-soft);
}

.mkt-line:first-child {
  border-top: 0;
}

.mkt-line__open,
.mkt-line__name {
  flex: 1 1 12em;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  overflow-wrap: anywhere;
}

.mkt-line__open {
  color: var(--accent-ink);
  cursor: pointer;
}

.mkt-line__open:hover {
  text-decoration: underline;
}

.mkt-line__meta {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.mkt-line--asset {
  flex-direction: column;
  align-items: stretch;
}

.mkt-line__sub {
  font-size: 13px;
  line-height: 18px;
  color: var(--ink-3);
}

.mkt-when {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mkt-line--asset .mkt-line__open {
  flex: none;
}

/* On a phone the campaign select takes the whole row under the chips. */
@media (max-width: 899.98px) {
  .filters__actions:has(.mkt-pick) {
    flex: 1 1 100%;
  }

  .mkt-pick {
    flex: 1 1 auto;
    max-width: none;
  }
}
