/* /platform (#19): the daily platform briefing. Existing tokens only; no transitions or animations here,
   so the desk's global prefers-reduced-motion block (desk-motion.css) covers everything on the page. */

.platform-section {
  margin-top: 28px;
}
.platform-section > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}
.platform-generated {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ink-2);
}
.platform-stale,
.platform-run-status,
.platform-triage-failed {
  margin: 0 0 12px;
}
/* #26 notices: long sentences plus a runs-on marker must wrap inside the banner at 320px. */
.platform-run-status > span,
.platform-triage-failed > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.platform-run-status .runs-on,
.platform-triage-failed .runs-on {
  margin-left: 4px;
}

/* Account signals: 1 column, 2 from 640px, 4 from 1024px. */
.psignals-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 18px;
}
.psignals-head h2,
.psignals-head p {
  margin: 0;
}
.psignals {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr);
  margin: 12px 0 0;
}
@media (min-width: 640px) {
  .psignals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1024px) {
  .psignals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.psignal {
  grid-template-columns: minmax(0, 1fr); /* the implicit auto column let a long flag push past the tile edge */
}
.psignal.is-flagged {
  border-color: var(--warn);
}
.chip.sig-flag {
  color: var(--warn);
  background: var(--warn-bg);
  max-width: 100%;
  align-items: flex-start;
  white-space: normal;
  text-align: left;
  line-height: 1.3;
}
.chip.sig-flag::before {
  flex: none;
  margin-top: 5px;
}
.psignal-rows {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin: 4px 0 0;
}
.psignal-rows dt,
.psignal-rows dd {
  margin: 0;
  font-size: 15px;
  color: var(--ink-2);
}
.psignal-rows dt {
  overflow-wrap: break-word;
}
.psignal-rows dd {
  white-space: nowrap;
  text-align: right;
  color: var(--ink);
  font-weight: 650;
}
.psignal-rows .is-flagged {
  font-weight: 750;
  color: var(--ink);
}

/* Campaign names beside a $ amount are too long for a two-column row in a quarter-width tile: stack them. */
.psignal-budget .psignal-rows {
  grid-template-columns: minmax(0, 1fr);
}
.psignal-budget .psignal-rows dd {
  text-align: left;
  margin-bottom: 6px;
}

/* Items: the .task card, striped by how much it affects the account. */
.task-affects-yes {
  --kind: var(--accent);
}
.task-affects-maybe {
  --kind: var(--kind-session);
}
.task-affects-no {
  --kind: var(--ink-3);
}
/* #26: an item Claude hasn't triaged. Neutral stripe; the label "Not triaged yet" says it in words. */
.task-untriaged {
  --kind: var(--ink-2);
}
.pitem-untriaged {
  margin: 8px 0 0;
  color: var(--ink-2);
}
.page-platform .task-title {
  display: flex;
  align-items: center;
  min-height: 44px; /* a one-line title is still a tap target */
  overflow: visible;
  overflow-wrap: anywhere;
}
.page-platform .task {
  overflow-wrap: anywhere;
}
.chip.platform-new {
  color: var(--accent);
  background: var(--accent-soft);
}
.pitem-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.pitem-body > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}
.pitem-body p {
  margin: 0;
}
@media (min-width: 1024px) {
  .pitem-body {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .pitem-body > .pitem-action {
    padding-left: 18px;
    border-left: 1px solid var(--rule);
  }
}
.pitem-action .runner-hand {
  white-space: normal; /* the long marker must wrap at 375px, not run off the card */
  border-radius: 14px;
  line-height: 1.3;
}
.pitem-label {
  margin: 0 0 2px;
  font: 650 13.5px/1.3 var(--body);
  color: var(--ink-3);
}
.bucket-platform-no {
  margin-top: 14px;
}

/* Sources footer. */
.psources {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.psources li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}
.platform-section p.small {
  margin: 0 0 6px;
}

/* Text that comes from a feed, the model or the briefing file: an unbreakable reason wraps inside its row, and a
   bidi override in it ends with its own element instead of reordering what follows. */
.psources li {
  min-width: 0;
}
.psources li > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.page-platform .task-title,
.page-platform .pitem-why p,
.page-platform .pitem-action p,
.page-platform .psignal-rows dt,
.page-platform .psources li > span,
.page-platform .platform-reason {
  unicode-bidi: isolate;
}
.page-platform .platform-reason {
  overflow-wrap: anywhere;
}
