/* ---------------------------------------------------------------- Project board

   A kanban: columns across, the board scrolling sideways when the screen is narrow,
   and the columns stacking on a phone. Two earlier attempts are the reason the sizes
   below are what they are. Six equal columns on a laptop are 190px each, which wraps
   a title over three lines; lanes down the page read well but are not a board. So:
   columns, a compact type scale, and cards that carry their type in a colour AND in
   a word, because colour alone is not a label.

   Type scale here: 14px card title, 12.5px card text, 11.5px chips. Nothing smaller.
   `.board-card` from the Operations pipeline is deliberately not reused: that one is
   a link, this one is a container with controls inside it. */

:root {
  /* Feedback: a muted rose. Somebody asked for this. */
  --feedback-ink: #8c4258;
  --feedback-bg: #fdf2f5;
  --feedback-line: #d59ead;
  /* Project: the house blue. Work we decided to do. */
  --project-ink: var(--brand-700);
  --project-bg: #eef4f8;
  --project-line: #8fb3c7;
}

/* The board page is allowed to be wider than the rest of the portal, so that six
   columns fit on a laptop without the last two living off the right edge. The page
   container is widened rather than the board broken out of it with 100vw, which
   would add a horizontal scrollbar to the whole document on Windows. */
.board-page .page-container {
  width: min(100%, 1680px);
}

.kanban {
  margin-top: 1rem;
  padding-bottom: 0.6rem;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: 0.5rem;
  align-items: start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.kanban-col {
  padding: 0.6rem 0.55rem 0.7rem;
  border-radius: var(--radius);
  background: #e9edf0;
}

.kanban-col-head {
  padding: 0 0.15rem;
}

.kanban-col-head h2 {
  margin: 0;
  display: flex;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.kanban-count {
  padding: 0.02rem 0.34rem;
  border-radius: 999px;
  background: rgba(24, 33, 39, 0.1);
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.kanban-col-note {
  margin: 0.15rem 0 0;
  color: var(--ink-soft);
  font-size: 0.7rem;
  line-height: 1.35;
}

.kanban-col-cards {
  margin-top: 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kanban-col-next { background: var(--brand-100); }
.kanban-col-live { background: var(--ok-bg); }
.kanban-col-declined { background: #eceff1; }

.kanban-empty {
  margin: 0;
  padding: 0.5rem 0;
  color: #8c979e;
  font-size: 0.72rem;
  text-align: center;
}

/* ---- the card ---- */

.kanban-card {
  padding: 0.55rem 0.6rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--panel);
}

.kanban-card-feedback {
  border-color: var(--feedback-line);
  border-left-color: var(--feedback-ink);
  background: var(--feedback-bg);
}

.kanban-card-project {
  border-color: var(--project-line);
  border-left-color: var(--project-ink);
  background: var(--project-bg);
}

.kanban-card.is-blocked {
  border-left-color: var(--amber);
}

.kanban-card-title {
  color: var(--ink);
  font-size: 0.875rem;
  font-weight: 650;
  line-height: 1.32;
  text-decoration: none;
}

.kanban-card-title:hover {
  text-decoration: underline;
}

.kanban-card-chips,
.kanban-card-origin,
.kanban-card-foot {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.4rem;
  align-items: center;
}

.kanban-card-text {
  margin: 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
}

.kanban-card-blocked {
  margin: 0;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(24, 33, 39, 0.05);
  color: var(--ink-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}

.kanban-card-phases {
  margin: 0;
  padding: 0.35rem 0 0;
  border-top: 1px solid rgba(24, 33, 39, 0.1);
  list-style: none;
}

.kanban-card-phases li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.12rem 0;
  font-size: 0.76rem;
}

.kanban-card-foot {
  color: var(--ink-soft);
  font-size: 0.7rem;
}

.kanban-card-foot .muted + .muted::before {
  content: "\00B7";
  margin-right: 0.4rem;
  opacity: 0.6;
}

.kanban-card-actions {
  margin-top: 0.1rem;
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

/* Small enough not to dominate the card, still a 28px target with the padding and
   the line box, which is what a mouse needs. The phone layout gives them more room
   below. */
.kanban-card-actions .btn,
.kanban-card-actions .btn-ghost {
  width: auto;
  padding: 0.2rem 0.55rem;
  border-color: transparent;
  background: rgba(24, 33, 39, 0.05);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
}

.kanban-card-actions .btn-ghost:hover {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink);
}

.kanban-card-actions form {
  margin: 0;
}

/* ---- chips: a label and a colour, never a colour alone ---- */

.chip {
  padding: 0.1rem 0.4rem;
  display: inline-block;
  border-radius: 4px;
  background: rgba(24, 33, 39, 0.07);
  color: #4c585f;
  font-size: 0.715rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: nowrap;
}

.kanban-card-feedback .chip-kind {
  background: var(--feedback-ink);
  color: #fff;
}

.kanban-card-project .chip-kind {
  background: var(--project-ink);
  color: #fff;
}

.chip-priority-high { background: var(--red-bg); color: var(--red); }
.chip-priority-medium { background: var(--amber-bg); color: var(--amber); }
.chip-priority-low { background: rgba(24, 33, 39, 0.07); color: #51606a; }

.chip-position { background: var(--brand-700); color: #fff; }
.chip-origin { background: #fff; color: var(--feedback-ink); border: 1px solid var(--feedback-line); }
.chip-answered { background: var(--ok-bg); color: var(--ok); }
.chip-hidden { background: var(--red-bg); color: var(--red); }

.chip-feedback-new { background: var(--info-bg); color: var(--info); }
.chip-feedback-in-progress { background: var(--amber-bg); color: var(--amber); }
.chip-feedback-done { background: var(--ok-bg); color: var(--ok); }
.chip-feedback-not-doing { background: rgba(24, 33, 39, 0.07); color: #51606a; }

.chip-status-inbox { background: rgba(24, 33, 39, 0.07); color: #51606a; }
.chip-status-next { background: var(--brand-100); color: var(--brand-700); }
.chip-status-progress { background: var(--amber-bg); color: var(--amber); }
.chip-status-test { background: var(--info-bg); color: var(--info); }
.chip-status-live { background: var(--ok-bg); color: var(--ok); }
.chip-status-declined { background: rgba(24, 33, 39, 0.07); color: #6b767d; }

@media (max-width: 900px) {
  /* A sideways scroll inside a page that also scrolls down is how half a board
     goes unseen. On a phone the columns stack, and the buttons grow back to a
     proper touch target. */
  .kanban {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow-x: visible;
  }

  .kanban-card-actions .btn,
  .kanban-card-actions .btn-ghost {
    padding: 0.45rem 0.8rem;
    font-size: 0.8rem;
  }
}

/* ---- the item page ----

   One page per item, in the order somebody reads it: what it is, what was asked and
   answered, what is inside, then the machinery. Edit, administration and history are
   folded away: they were three open panels, which is what made the page feel like a
   form rather than a record. */

.item-head {
  padding-left: 0.85rem;
  border-left: 4px solid var(--line-strong);
}

.item-head-feedback { border-left-color: var(--feedback-ink); }
.item-head-project { border-left-color: var(--project-ink); }

.item-chips {
  margin: 0.5rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}

.chip-kind-feedback { background: var(--feedback-ink); color: #fff; }
.chip-kind-project { background: var(--project-ink); color: #fff; }

.item-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  align-items: flex-end;
}

.item-toolbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
  margin: 0;
}

.item-toolbar .field-note {
  flex: 1 1 100%;
  margin: 0;
}

.panel-feedback {
  border-left: 4px solid var(--feedback-line);
}

.origin {
  margin: 0.6rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--feedback-bg);
}

.origin-head {
  margin: 0 0 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.origin-body {
  margin: 0;
  white-space: pre-wrap;
}

.origin-answer {
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  background: #fff;
}

.origin-answer h3 {
  margin: 0 0 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.origin-answer p {
  margin: 0;
  white-space: pre-wrap;
}

.item-text {
  white-space: pre-wrap;
}

.item-dates {
  margin: 0.9rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.4rem;
}

.item-dates dt {
  color: var(--ink-soft);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.item-dates dd {
  margin: 0 1.2rem 0 0;
  font-weight: 650;
}

.item-phases,
.item-files,
.item-history {
  margin: 0;
  padding: 0;
  list-style: none;
}

.item-phases li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--line);
}

.item-phases li:last-child,
.item-history li:last-child {
  border-bottom: 0;
}

.item-files li {
  padding: 0.25rem 0;
}

.item-comment {
  margin: 0.6rem 0;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--ground);
}

/* Zak's own margin. Marked so it cannot be mistaken for something ENV can see. The
   fence itself is a query in app/board/routes.py, not this colour. */
.item-comment.is-internal {
  border-left: 3px solid var(--red);
  background: var(--red-bg);
}

.item-comment-head {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: baseline;
}

.item-comment-body {
  margin: 0.3rem 0 0;
  white-space: pre-wrap;
}

.item-fold > summary {
  cursor: pointer;
  font-weight: 650;
}

.item-fold[open] > summary {
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.item-history li {
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.82rem;
}

.item-add-phase {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.item-link-feedback {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
}

.item-link-feedback label {
  flex: 1 1 20rem;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: flex-end;
}

.field-row > label {
  flex: 1 1 12rem;
}

.pill-status-inbox {
  background: #edf1f3;
  color: #51606a;
}

.pill-status-next {
  background: var(--brand-100);
  color: var(--brand-700);
}

.pill-status-progress {
  background: var(--amber-bg);
  color: var(--amber);
}

.pill-status-test {
  background: var(--info-bg);
  color: var(--info);
}

.pill-status-live {
  background: var(--ok-bg);
  color: var(--ok);
}

.pill-status-declined {
  background: #eceff1;
  color: #6b767d;
}

.flash-warn {
  margin: 1rem 0;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--amber-bg);
  color: var(--amber);
  font-weight: 650;
}

label.check {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  font-weight: 600;
}

label.check input {
  width: auto;
  margin: 0;
}

@media (max-width: 760px) {
  .board-lane-cards {
    grid-template-columns: 1fr;
  }
}

/* The card being dragged. Kept faint rather than hidden, so the gap it leaves is
   obviously the place it will land. */
.board-card-dragging {
  opacity: 0.45;
  border-color: var(--brand-700);
}

[draggable="true"].kanban-card {
  cursor: grab;
}

/* The shared .btn-tiny is a full-width button for stacked table actions. In a card
   footer it has to sit beside its neighbours. */
.kanban-card-actions .btn-tiny {
  width: auto;
}

.board-add > summary {
  cursor: pointer;
  font-weight: 650;
}

.board-add .field-note {
  margin-top: 0.3rem;
}

.board-footnote {
  margin-top: 1rem;
}

/* A menu in the top bar: the board and the feedback list under one heading. Built
   on <details> so it works with no JavaScript; app.js only adds closing it by
   clicking away or pressing Escape. */
.topbar-menu {
  position: relative;
}

.topbar-menu > summary {
  padding: 0.3rem 0.1rem;
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.topbar-menu > summary::-webkit-details-marker {
  display: none;
}

.topbar-menu > summary::after {
  content: "";
  width: 0;
  height: 0;
  border-top: 4px solid currentColor;
  border-right: 3.5px solid transparent;
  border-left: 3.5px solid transparent;
  opacity: 0.75;
}

.topbar-menu-items {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 40;
  min-width: 11rem;
  margin-top: 0.4rem;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.topbar-menu-items a {
  padding: 0.42rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

.topbar-menu-items a:hover {
  background: var(--brand-100);
}

/* The feedback an item answers. A different colour from the workstream chip so the
   two are not read as one label. */
.pill-origin {
  background: var(--info-bg);
  color: var(--info);
}

/* A capitalised line on its own inside a comment is a heading. The long transcribed
   rounds from ENV's spreadsheet are unreadable as one wall of text. */
.comment-heading {
  display: inline-block;
  margin-top: 0.35rem;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.item-comment-body > .comment-heading:first-child {
  margin-top: 0;
}

/* The Create in Synergy panel, first in the job's Folder & Synergy tab. */
.synergy-create .btn-big {
  display: inline-block;
  padding: 0.7rem 1.4rem;
  font-size: 1rem;
}

.synergy-actions,
.synergy-create-form {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.synergy-state {
  font-size: 0.9rem;
}

.synergy-top-action {
  margin: 0 0 1.25rem;
}

/* Create in Synergy while it runs in the background (26 October 2026). */
.synergy-running {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 34rem;
}

.synergy-running .spinner {
  width: 1rem;
  height: 1rem;
  flex: none;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: synergy-spin 0.8s linear infinite;
}

@keyframes synergy-spin {
  to { transform: rotate(360deg); }
}

.synergy-failed {
  margin: 0 0 0.5rem;
}

