/* War Room — the per-scope room you walk into to find out whether somebody is already doing this.
   Two halves with deliberately unequal weight: the activity strip is what people came for, so it
   reads first and largest; the wall sits under it. */

.war-room-view {
  min-width: 0;
  padding: 0;
  background: #fbfbf8;
}

.war-room-shell {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 40px 28px 48px;
}

.war-room-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.war-room-manual-add {
  margin-left: auto;
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 12px;
}

.war-room-header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.war-room-scope {
  font-size: 13px;
  color: #6b7280;
}

.war-room-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.war-room-section-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.war-room-section-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.war-room-counts {
  font-size: 12px;
  color: #6b7280;
}

.war-room-empty,
.war-room-loading,
.war-room-error {
  margin: 0;
  font-size: 13px;
  color: #6b7280;
}

.war-room-error { color: #b91c1c; }

.war-room-entries,
.war-room-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* One row per run. A three-column grid rather than inline text so the state token, the label and
   the "when + who" line stay in the same places down the list — the strip is scanned, not read. */
.war-room-entry {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid #e6e6e0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.war-room-entry-state {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b7280;
}

.war-room-entry-state[data-state="running"] { color: #1d4ed8; }
.war-room-entry-state[data-state="needs_attention"] { color: #b45309; }
.war-room-entry-state[data-state="finished"] { color: #15803d; }

/* min-width:0 so a long dossier label truncates instead of pushing the meta column off the row. */
.war-room-entry-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.war-room-entry-link {
  color: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.war-room-entry-link:hover,
.war-room-entry-link:focus {
  color: #1d4ed8;
}

.war-room-entry-meta {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
}

/* Withheld material is NAMED, so it needs to look deliberate rather than broken. */
.war-room-entry-withheld .war-room-entry-label { color: #6b7280; font-style: italic; }

.war-room-withheld {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.war-room-wall {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.war-room-department {
  padding: 12px 14px;
  border: 1px solid #e6e6e0;
  border-radius: 8px;
  background: #fff;
}

.war-room-department-unassigned { background: #fafaf7; }

/* The launch-time notice. It sits at the top of the launch modal and has to be noticed without
   being a wall of colour people learn to skip. */
.war-room-launch-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #fcd34d;
  border-left-width: 3px;
  border-radius: 8px;
  background: #fffbeb;
  font-size: 13px;
}

.war-room-launch-notice-lead {
  margin: 0 0 6px;
  font-weight: 600;
}

.war-room-launch-notice ul {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.war-room-launch-notice-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.war-room-launch-notice-link:hover,
.war-room-launch-notice-link:focus {
  color: #1d4ed8;
}

.war-room-launch-notice-status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid #fde68a;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.war-room-launch-notice-foot {
  margin: 8px 0 0;
  font-size: 12px;
  color: #78716c;
}

@media (max-width: 720px) {
  .war-room-shell { padding: 24px 16px 32px; }
  /* Stacked on a narrow screen: the three-column row would otherwise squeeze the label to nothing,
     and the label is the one thing the strip exists to show. */
  .war-room-entry {
    grid-template-columns: minmax(0, 1fr);
    gap: 3px;
  }
  .war-room-entry-label { white-space: normal; }
  .war-room-entry-meta { white-space: normal; }
}


/* -------------------------------------------------------------------------------------------
   THE WALL ITEM.
   Phase 2/3 added approve/return/note/promote behind a POST route; until these rules existed the
   page rendered a bare list of titles, so a correct feature still looked like nothing shipped.
   Laid out as a block rather than the strip's three-column grid: an item carries a reason and a
   row of controls, and those wrap. */

.war-room-item {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f4;
}

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

.war-room-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.war-room-item-state {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: #78716c;
}

.war-room-item-state[data-state="approved"] { color: #15803d; }
.war-room-item-state[data-state="returned"] { color: #b91c1c; }
.war-room-item-state[data-state="unreviewed"] { color: #b45309; }
.war-room-item-state[data-state="pending"] { color: #78716c; }

.war-room-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #1c1917;
}

/* A flag states something the state alone cannot: "approved, then changed" and "nobody reviewed
   it in time" are both on the wall, and they are not the same fact. */
.war-room-item-flag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
}

.war-room-item-promoted {
  background: #ecfdf5;
  color: #065f46;
}

.war-room-item-meta {
  margin-top: 2px;
  font-size: 12px;
  color: #78716c;
}

.war-room-item-reason {
  margin: 6px 0 0;
  font-size: 13px;
  color: #44403c;
  border-left: 2px solid #e7e5e4;
  padding-left: 8px;
}

.war-room-item-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.war-room-action {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid #d6d3d1;
  border-radius: 6px;
  background: #ffffff;
  color: #44403c;
  cursor: pointer;
}

.war-room-action:hover { background: #f5f5f4; }

/* Withheld items carry no controls and no counts — see the service's withheld branch for why the
   counts are material too. */
.war-room-item-withheld .war-room-item-title { color: #78716c; font-style: italic; }

/* The activity strip's own wrapper, and its empty state. */
.war-room-activity { margin-bottom: 20px; }
.war-room-activity-empty .war-room-empty { margin-top: 4px; }

@media (max-width: 720px) {
  .war-room-item-actions { gap: 4px; }
  .war-room-action { flex: 1 1 auto; }
}

.war-room-emission-warning {
  color: #b45309;
  font-weight: 600;
}


/* -------------------------------------------------------------------------------------------
   DEPARTMENT SECTIONS AS A GRID.
   One per full-width row put a dozen mostly-empty walls between the reader and anything with
   content on it — the roster is ~13 departments and most are empty most of the time, so the
   default view was a screen and a half of "Nothing on this wall yet." Auto-fit rather than a
   fixed column count so the same rule gives three columns on a wide screen, two on a laptop and
   one on a phone without a breakpoint for each. */
.war-room-wall {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  align-items: start;
}

/* The heading spans the grid rather than becoming a cell of it. */
.war-room-wall > .war-room-section-header {
  grid-column: 1 / -1;
}

.war-room-manual-links {
  grid-column: 1 / -1;
}

.war-room-manual-entry {
  display: grid;
  gap: 7px;
}

.war-room-manual-entry-name {
  color: #1c1917;
  font-size: 14px;
}

.war-room-manual-link {
  min-width: 0;
  color: #1d4ed8;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.war-room-manual-link:hover { color: #1e40af; }

.war-room-manual-form {
  display: grid;
  gap: 14px;
}

.war-room-manual-form label {
  display: grid;
  gap: 5px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.war-room-manual-form input,
.war-room-manual-form textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  padding: 9px 10px;
  font: 14px/1.4 Inter, system-ui, Segoe UI, Arial, sans-serif;
}

.war-room-manual-form textarea { resize: vertical; }

.war-room-manual-form-status {
  min-height: 18px;
  margin: 0;
  color: #b42318;
  font-size: 12px;
}

.war-room-manual-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.war-room-manual-form-actions button { border-radius: 6px; }

/* A department with items is worth more room than one without: it spans two columns where there
   is space, so a wall with real content does not get squeezed into a narrow strip. */
.war-room-department-populated {
  grid-column: span 2;
}

@media (max-width: 760px) {
  .war-room-wall { grid-template-columns: minmax(0, 1fr); }
  .war-room-department-populated { grid-column: auto; }
}

/* Step position sits with the label, not the timing column: it describes WHAT the run is doing,
   which is the same question the label answers. */
.war-room-entry-step {
  margin-left: 8px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  white-space: nowrap;
}

/* Dormant runs: present, counted, and visibly not competing with live work. */
.war-room-dormant {
  margin-top: 10px;
  border-top: 1px solid #f5f5f4;
  padding-top: 8px;
}

.war-room-dormant > summary {
  cursor: pointer;
  font-size: 12px;
  color: #78716c;
  list-style: revert;
}

.war-room-dormant > summary:hover { color: #44403c; }

.war-room-entry-dormant { opacity: 0.72; }
.war-room-entry-dormant .war-room-entry-state { color: #a8a29e; }

/* The link to the thing itself. The wall named work and gave no way to look at it. */
.war-room-item-open {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid #d6d3d1;
  color: #44403c;
  text-decoration: none;
  white-space: nowrap;
}

.war-room-item-open:hover { background: #f5f5f4; }

/* Notes were counted and never shown, so adding one looked like nothing happened. */
.war-room-item-notes {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.war-room-item-notes li {
  border-left: 2px solid #e7e5e4;
  padding-left: 8px;
}

.war-room-item-note-body {
  display: block;
  font-size: 13px;
  color: #292524;
  white-space: pre-wrap;
}

.war-room-item-note-meta {
  display: block;
  font-size: 11px;
  color: #a8a29e;
  margin-top: 1px;
}

/* Withdrawing a note is a quiet act, so its control is quiet until you go looking for it. */
.war-room-note-remove {
  font: inherit;
  font-size: 11px;
  margin-left: 6px;
  padding: 0 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #a8a29e;
  cursor: pointer;
}

.war-room-note-remove:hover {
  background: #fef2f2;
  color: #b91c1c;
}

/* The title IS the rename control — that is where somebody looking at an unreadable
   300-character label goes to fix it. Styled as text until hovered, so the wall still reads as a
   wall rather than a row of buttons. */
button.war-room-item-title {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1c1917;
  text-align: left;
  padding: 0;
  border: 0;
  background: none;
  cursor: text;
}

button.war-room-item-title:hover {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
