/* PIN CALENDAR — the month grid, the floating "Post this pin" card, the
   campaign form/preview/sending job.

   Matches plans/pin-calendar/mock/index.html panels 1–3, which the owner
   approved and which is frozen. Every color here is either one of the pin
   library's six blues (pin_library.css's --pl-* tokens, inherited through
   .pl-root) or one of the app shell's own tokens — no new palette.

   Prefix: .plc- (pin calendar) so nothing collides with pin_library.css's
   .pl- classes, which this screen also renders inside. */

/* ---------------- status line above the grid ---------------- */
.plc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  background: var(--pl-surface);
  border: 1px solid var(--pl-rail);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.plc-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--success, #2fbf71);
  display: inline-block;
  margin-right: 6px;
}
.plc-late .plc-dot { background: var(--danger, #e5484d); }
.plc-late { color: var(--danger-ink, #a3282c); font-weight: 700; }
.plc-practice {
  background: color-mix(in srgb, var(--sunny, #ffc93c) 25%, transparent);
  border: 1px solid var(--sunny, #ffc93c);
  color: var(--sunny-ink, #8a5a00);
  border-radius: 10px;
  padding: 8px 12px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

/* ---------------- month head ---------------- */
.plc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.plc-head h2 { margin: 0; font-size: 16px; color: var(--pl-ink); }
.plc-nav {
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid var(--pl-rail);
  background: #fff;
  color: var(--pl-action);
  border-radius: 6px;
  width: 30px;
  height: 30px;
}
.plc-thismonth {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--pl-rail);
  background: #fff;
  color: var(--pl-action);
  border-radius: 999px;
  padding: .35em 1em;
}

/* ---------------- month grid ---------------- */
.plc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.plc-dow {
  font-size: 12px;
  font-weight: 800;
  color: var(--pl-muted);
  text-align: center;
  padding: 4px 0;
}
.plc-day {
  background: #fff;
  border: 1px solid var(--pl-rail);
  border-radius: 8px;
  min-height: 116px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.plc-day.plc-other { background: #F3F8FF; opacity: .7; }
.plc-date { font-size: 12px; font-weight: 800; color: var(--pl-muted); }
.plc-day.plc-today .plc-date {
  color: #fff;
  background: var(--pl-action);
  border-radius: 999px;
  padding: 1px 7px;
  align-self: flex-start;
}
.plc-item {
  display: flex;
  gap: 7px;
  align-items: flex-start;
  background: var(--pl-surface);
  border: 1px solid var(--pl-rail);
  border-radius: 6px;
  padding: 5px;
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
}
.plc-item.plc-ghost { opacity: .55; border-style: dashed; background: #fff; cursor: default; }
.plc-thumb {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--pl-rail);
  border: 1px solid var(--pl-rail);
}
.plc-itemtext { min-width: 0; font-size: 11.5px; line-height: 1.35; color: var(--pl-ink); }
.plc-itemtext .plc-kind { font-weight: 800; }
.plc-itemtext .plc-board { color: var(--pl-muted); display: block; }
.plc-st { display: block; font-weight: 800; margin-top: 1px; }
.plc-st-scheduled { color: var(--pl-action); }
.plc-st-preparing { color: var(--sunny-ink, #8a5a00); }
.plc-st-posted { color: var(--success-ink, #197a48); }
.plc-st-failed,
.plc-st-missed { color: var(--danger-ink, #a3282c); }
.plc-st-needs_check { color: var(--sunny-ink, #8a5a00); }
.plc-st-by_hand { color: var(--pl-muted); }
.plc-st-practice { color: var(--sunny-ink, #8a5a00); }
.plc-itembtns { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* Preview grid: each item is a vertical stack so the text gets the whole
   cell width and words break between words only, never mid-word. */
.plc-grid.plc-preview .plc-day { min-height: 104px; padding: 5px; gap: 4px; cursor: default; }
.plc-grid.plc-preview .plc-item { flex-direction: column; gap: 2px; padding: 4px; min-width: 0; }
.plc-grid.plc-preview .plc-thumb { width: 20px; height: 20px; border-radius: 5px; }
.plc-grid.plc-preview .plc-itemtext {
  width: 100%;
  min-width: 0;
  font-size: 10.5px;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
  white-space: normal;
}
.plc-grid.plc-preview .plc-kind,
.plc-grid.plc-preview .plc-time { display: block; }
.plc-grid.plc-preview .plc-time { white-space: nowrap; font-weight: 600; }
.plc-grid.plc-preview .plc-date { font-size: 11px; }

/* ---------------- campaign list under the grid ---------------- */
.plc-list {
  background: var(--pl-surface);
  border: 1px solid var(--pl-rail);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}
.plc-list h3 { margin: 0 0 6px; font-size: 15px; color: var(--pl-ink); }
.plc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--pl-rail);
}
.plc-row:last-child { border-bottom: none; }
.plc-row .plc-name { font-weight: 800; font-size: 14px; }
.plc-row .plc-meta { font-size: 13px; color: var(--pl-muted); }

/* ---------------- the floating card ---------------- */
.plc-card {
  position: absolute;
  z-index: 60;
  width: 330px;
  max-width: calc(100vw - 24px);
  background: var(--bg-elevated, #fff);
  border: 1px solid var(--border, #ece1d8);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(32, 26, 43, .10), 0 2px 6px rgba(32, 26, 43, .06);
  padding: 16px;
  color: var(--text, #201a2b);
  /* Never taller than the window: a long card scrolls inside itself. */
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}
.plc-card.plc-inline { position: static; width: 100%; box-shadow: none; max-height: none; overflow: visible; }
.plc-card h3 { margin: 0 0 4px; font-size: 15px; }
.plc-card .plc-sub { font-size: 12px; color: var(--text-muted, #6b6478); margin: 0 0 10px; }
.plc-field { margin-bottom: 12px; }
.plc-label {
  display: block;
  font-weight: 700;
  font-size: .8rem;
  color: var(--text-muted, #6b6478);
  margin-bottom: 6px;
}
.plc-input {
  width: 100%;
  font-family: inherit;
  font-size: .9rem;
  color: var(--text, #201a2b);
  background: var(--bg-sunken, #f6efe6);
  border: 1px solid var(--border, #ece1d8);
  border-radius: 10px;
  padding: .5em .7em;
}
.plc-matchlist {
  border: 1px solid var(--border, #ece1d8);
  border-radius: 10px;
  margin-top: 6px;
  /* About five rows, then the list scrolls. */
  max-height: 240px;
  overflow-y: auto;
}
.plc-match {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  font-size: .82rem;
  border-bottom: 1px solid var(--border, #ece1d8);
  width: 100%;
  font: inherit;
  font-size: .82rem;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  cursor: pointer;
}
.plc-match:last-child { border-bottom: none; }
.plc-match.plc-on {
  background: color-mix(in srgb, var(--primary, #8b5cf6) 12%, transparent);
  font-weight: 700;
}
.plc-seg { display: flex; gap: 6px; }
.plc-seg button {
  flex: 1;
  font: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  padding: .5em;
  border-radius: 10px;
  border: 1px solid var(--border, #ece1d8);
  background: var(--bg-sunken, #f6efe6);
  color: var(--text, #201a2b);
}
.plc-seg button[aria-pressed="true"] {
  background: var(--primary, #8b5cf6);
  color: #fff;
  border-color: var(--primary, #8b5cf6);
}
.plc-boardlist {
  border: 1px solid var(--border, #ece1d8);
  border-radius: 10px;
  overflow: hidden;
  max-height: 168px;
  overflow-y: auto;
}
.plc-boardlist button {
  display: block;
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  font-size: .85rem;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border, #ece1d8);
  cursor: pointer;
  color: inherit;
}
.plc-boardlist button:last-child { border-bottom: none; }
.plc-boardlist button.plc-on {
  background: color-mix(in srgb, var(--primary, #8b5cf6) 12%, transparent);
  font-weight: 700;
}
.plc-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.plc-note { font-size: .78rem; color: var(--text-muted, #6b6478); line-height: 1.45; margin: 10px 0; }
.plc-note.plc-strong { font-weight: 700; color: var(--text, #201a2b); }
.plc-mini { font-size: .8rem; color: var(--text-muted, #6b6478); }
.plc-warn {
  background: color-mix(in srgb, var(--sunny, #ffc93c) 25%, transparent);
  border: 1px solid var(--sunny, #ffc93c);
  color: var(--sunny-ink, #8a5a00);
  border-radius: 10px;
  padding: 10px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 10px;
}
.plc-stopbox {
  background: color-mix(in srgb, var(--danger, #e5484d) 12%, transparent);
  border: 1px solid var(--danger, #e5484d);
  color: var(--danger-ink, #a3282c);
  border-radius: 10px;
  padding: 10px;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 10px;
}
.plc-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.plc-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: .95rem;
  border: none;
  border-radius: 999px;
  padding: .7em 1.4em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4em;
}
.plc-btn-primary { background: var(--primary, #8b5cf6); color: #fff; }
.plc-btn-secondary {
  background: var(--bg-sunken, #f6efe6);
  color: var(--text, #201a2b);
  border: 1px solid var(--border, #ece1d8);
}
.plc-btn-ghost {
  background: transparent;
  color: var(--text, #201a2b);
  border: 1px solid var(--border, #ece1d8);
}
.plc-btn-sm { font-size: .8rem; padding: .45em 1em; }
.plc-btn:focus-visible,
.plc-item:focus-visible,
.plc-day:focus-visible,
.plc-nav:focus-visible,
.plc-thismonth:focus-visible,
.plc-match:focus-visible,
.plc-boardlist button:focus-visible,
.plc-seg button:focus-visible {
  outline: 2px solid var(--focus-ring, #6d28d9);
  outline-offset: 2px;
}
.plc-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--bg-sunken, #f6efe6);
  border: 1px solid var(--border, #ece1d8);
  overflow: hidden;
  margin: 8px 0 4px;
}
.plc-bar span { display: block; height: 100%; background: var(--primary, #8b5cf6); }
.plc-log {
  background: #1d1a26;
  color: #e8e2f5;
  border-radius: 10px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 110px;
  overflow: auto;
  white-space: pre-wrap;
}
.plc-error { color: var(--danger-ink, #a3282c); font-size: .82rem; font-weight: 700; }

/* ---------------- campaign form + preview side by side ---------------- */
.plc-campaign { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.plc-formcol { flex: 0 0 300px; min-width: 0; }
.plc-previewcol { flex: 1 1 560px; min-width: 560px; }
.plc-cardlabel {
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted, #6b6478);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin: 0 0 6px;
}
@media (max-width: 640px) {
  .plc-previewcol { min-width: 0; flex: 1 1 100%; }
}

/* ------------------------- the "What works" tab ------------------------- */
.plw-card {
  background: var(--pl-surface);
  border: 1px solid var(--pl-rail);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
}
.plw-h { margin: 0 0 8px; font-size: 15px; color: var(--pl-ink); }
.plw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plw-th {
  text-align: left;
  font-size: 11px;
  font-weight: 800;
  color: var(--pl-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 0 8px 6px 0;
  border-bottom: 1px solid var(--pl-rail);
}
.plw-th.plw-num, .plw-cell.plw-num { text-align: right; padding-right: 0; }
.plw-row td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--pl-rail); }
.plw-name { color: var(--pl-ink); font-weight: 600; }
.plw-note { margin-left: 8px; font-size: 11px; font-weight: 500; color: var(--pl-muted); }
.plw-sub {
  padding: 10px 0 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--pl-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.plw-empty { margin: 0; font-size: 13px; color: var(--pl-muted); }
.plw-note-big { margin: 0 0 14px; font-size: 13px; color: var(--pl-ink); max-width: 46em; }
.plw-error { margin: 0 0 14px; font-size: .82rem; font-weight: 700; color: var(--danger-ink, #a3282c); }
.plc-stats { display: block; font-size: 10px; color: var(--pl-muted); }

/* Change card: the posting's own status line. */
.plc-cardstatus { font-size: 12px; font-weight: 800; margin: 0 0 10px; }
/* Under the greyed-out Video choice. */
.plc-mini-note { font-size: 11px; color: var(--text-muted, #6b6478); margin: 4px 0 0; }
/* Real postings stay visible (not greyed) while a campaign preview is drawn. */
.plc-grid.plc-preview .plc-item.plc-real { opacity: 1; border-style: solid; }
/* The campaign form's tag box. */
.plc-tagbox { margin-top: 8px; }
/* fizzavo.com can't be reached: the banner with its Try again button. */
.plc-down { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* The floating card's buttons stay in view while the card scrolls. */
.plc-card:not(.plc-inline) > .plc-btns:last-child {
  position: sticky; bottom: -16px; margin: 6px -16px -16px; padding: 10px 16px 16px;
  background: var(--bg-elevated, #fff); border-top: 1px solid var(--border, #ece1d8);
}
/* A short window: the pin list shows about three rows. */
@media (max-height: 760px) {
  .plc-matchlist { max-height: 144px; }
}
