/* Designer-facing production Board and Needs-you review queue. */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.production-board,
.needs-page {
  --production-surface: #17171d;
  --production-raised: #1f1f27;
  --production-soft: #24242d;
  min-height: 100%;
  padding: 26px 24px 72px;
  color: var(--fg);
}

.production-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin: 0 0 22px;
}

.production-head h2 {
  margin: 0;
  font-size: clamp(24px, 2.3vw, 34px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.production-head p:not(.production-eyebrow) {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.production-eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.production-loading,
.production-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  color: var(--muted);
}

.board-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.board-controls label:first-child { flex: 1; }
.board-controls input,
.board-controls select {
  width: 100%;
  min-height: 36px;
  background: var(--production-surface);
}
.board-controls select { min-width: 155px; }

.board-exception-filters,
.needs-filters {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.board-exception-filters > span {
  margin-right: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.board-exception-filters button,
.needs-filters button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 30px;
  border-radius: 999px;
  color: var(--muted);
}

.board-exception-filters button b,
.needs-filters button b {
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  place-items: center;
  border-radius: 9px;
  background: var(--bg);
  color: var(--fg);
  font-size: 10px;
}

.board-exception-filters button.on,
.needs-filters button.on {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--bg);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 10px;
  min-height: 510px;
  padding-bottom: 12px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.kanban-column {
  display: flex;
  min-width: 220px;
  max-height: calc(100vh - 260px);
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--production-surface);
  scroll-snap-align: start;
}

.kanban-column > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 13px 11px;
  border-bottom: 1px solid var(--line);
}

.kanban-column > header h3 {
  margin: 0;
  font-size: 12px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.kanban-column > header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.kanban-column > header > span {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border-radius: 12px;
  background: var(--production-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.kanban-stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  overflow-y: auto;
}

.kanban-empty {
  display: grid;
  min-height: 78px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
}

.kanban-card {
  position: relative;
  flex: none;
  padding: 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--production-raised);
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.kanban-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--muted);
}
.kanban-card.in_progress::before,
.kanban-card.leased::before { background: var(--accent); }
.kanban-card.review::before { background: var(--info); }
.kanban-card.approved::before { background: var(--ok); }
.kanban-card.failed::before,
.kanban-card.escalated::before,
.kanban-card.rejected::before { background: var(--err); }

.kanban-card:hover,
.kanban-card:focus-visible {
  border-color: var(--muted);
  background: #24242d;
  outline: none;
  transform: translateY(-1px);
}

.kanban-card-top,
.kanban-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.work-type {
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.work-priority {
  color: var(--muted);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.kanban-card h4 {
  margin: 9px 0 5px;
  font-size: 12px;
  line-height: 1.35;
}

.kanban-card > p {
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-card footer {
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.exception-view {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--production-surface);
}

.exception-view > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.exception-view h3 { margin: 0; }
.exception-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 9px;
  padding: 9px;
}

/* Needs-you list */

.needs-page {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}

.needs-head h2 span {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  margin-left: 7px;
  place-items: center;
  vertical-align: 4px;
  border-radius: 14px;
  background: var(--accent);
  color: #17130a;
  font-size: 12px;
  letter-spacing: 0;
}

.needs-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.needs-card {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 116px;
  padding: 13px 13px 13px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--production-surface);
}

.needs-card-status {
  align-self: stretch;
  border-radius: 0 3px 3px 0;
  background: var(--info);
}
.needs-card.escalated .needs-card-status { background: var(--err); }
.needs-card.stale .needs-card-status { background: var(--warn); }

.needs-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 10px;
}

.decision-kind {
  padding: 3px 7px;
  border-radius: 9px;
  background: #24303d;
  color: var(--info);
  font-weight: 700;
}
.decision-kind.escalated { background: #3d2020; color: var(--err); }
.decision-kind.stale { background: #3d3520; color: var(--warn); }

.needs-card h3 {
  margin: 9px 0 5px;
  font-size: 15px;
}
.needs-card-body > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.needs-card-body > small { color: var(--muted); }
.review-open { display: inline-flex; min-height: 32px; align-items: center; margin-right: 5px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; color: var(--fg); text-decoration: none; }
.review-open:hover { border-color: var(--accent); color: var(--accent); }

.needs-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  align-content: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  text-align: center;
}
.needs-empty > span {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  background: #1d3527;
  color: var(--ok);
  font-size: 18px;
}
.needs-empty h3 { margin: 13px 0 3px; }
.needs-empty p { margin: 0; color: var(--muted); }

/* Context drawer */

.review-scrim {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: rgba(3, 3, 6, .66);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
.review-scrim.open { opacity: 1; pointer-events: auto; }

.review-drawer {
  position: fixed;
  z-index: 81;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(620px, 94vw);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: var(--bg2);
  box-shadow: -20px 0 80px rgba(0, 0, 0, .42);
  transform: translateX(102%);
  transition: transform 180ms ease;
}
.review-drawer.open { transform: translateX(0); }

.review-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.review-drawer-head h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
}
.drawer-close {
  display: grid;
  width: 32px;
  height: 32px;
  flex: none;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
}
.drawer-loading { margin: auto; color: var(--muted); }
.review-drawer-scroll { padding: 18px 22px 44px; overflow-y: auto; }

.review-context-summary,
.review-context-block,
.review-context-actions {
  margin: 0 0 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg3);
}

.review-context-summary > p {
  margin: 0 0 13px;
  font-size: 13px;
  line-height: 1.5;
}
.review-context-summary dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin: 0;
}
.review-context-summary dl > div {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.review-context-summary dt {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.review-context-summary dd { margin: 4px 0 0; font-size: 11px; }

.review-context-block > h3,
.review-context-actions h3 {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.review-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
.review-preview-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 6px;
  object-fit: cover;
}

.review-artifacts { display: flex; flex-direction: column; gap: 6px; }
.review-artifacts a {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--fg);
  text-decoration: none;
}
.review-artifacts a:hover { border-color: var(--muted); }
.review-artifacts small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.review-artifacts b { color: var(--info); font-size: 10px; }

.review-history { margin: 10px 0 0; padding: 0; list-style: none; }
.review-history li {
  display: grid;
  grid-template-columns: 135px 1fr;
  gap: 5px 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 11px;
}
.review-history li span { color: var(--muted); }
.review-history li p { grid-column: 1 / -1; margin: 0; color: var(--muted); }

.review-context-actions {
  position: sticky;
  bottom: -30px;
  z-index: 2;
  margin-top: 18px;
  box-shadow: 0 -16px 34px rgba(16, 16, 20, .7);
}
.review-context-actions label {
  display: block;
  margin-bottom: 6px;
  color: var(--fg);
  font-size: 11px;
}
.review-context-actions label span { color: var(--muted); }
.review-context-actions textarea { width: 100%; resize: vertical; }
.review-decision-buttons,
.review-context-links {
  display: flex;
  gap: 7px;
  margin-top: 8px;
}
.review-decision-buttons button { min-height: 34px; flex: 1; }
.review-decision-buttons .approve {
  background: var(--ok);
  border-color: var(--ok);
  color: #0a1710;
  font-weight: 700;
}
.review-decision-buttons .reject {
  background: var(--err);
  border-color: var(--err);
  color: #170a0a;
  font-weight: 700;
}
.review-context-links { padding-top: 5px; border-top: 1px solid var(--line); }

/* Artifact promotion is a gate, not a four-button form. Keep approval obvious;
 * disclose iteration and terminal rejection only when the reviewer asks. */
.review-artifact-summary { border-radius: 2px; background: color-mix(in srgb, var(--bg3) 88%, var(--accent)); }
.review-structure-evidence {
  margin: 0 0 14px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.review-structure-evidence header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 13px; }
.review-structure-evidence header span { color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.review-structure-evidence header b { font-family: Georgia, serif; font-size: 18px; font-weight: 400; }
.review-structure-evidence dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.review-structure-evidence dl > div { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.review-structure-evidence dt { color: var(--muted); font-size: 9px; letter-spacing: .08em; text-transform: uppercase; }
.review-structure-evidence dd { margin: 5px 0 0; font-size: 12px; line-height: 1.4; }
.review-structure-evidence nav { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 13px; }
.review-structure-evidence nav a { color: var(--info); font-size: 11px; font-weight: 700; text-decoration: none; }
.review-structure-evidence nav a::after { content: " →"; }
.review-technical-evidence > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.review-technical-evidence > summary small { color: var(--muted); font-size: 9px; font-weight: 400; }
.review-technical-evidence[open] > summary { margin-bottom: 14px; }
.review-technical-evidence > h3 { margin-top: 15px; }

.review-context-actions.review-artifact-actions {
  position: static;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.review-artifact-actions > h3 { margin: 24px 0 8px; color: var(--muted); }
.review-approval-gate { display: grid; gap: 8px; padding: 18px; border: 1px solid #536f58; background: #111813; }
.review-approval-gate > span { color: #a6c9aa; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.review-approval-gate > b { font-family: Georgia, serif; font-size: 21px; font-weight: 400; line-height: 1.2; }
.review-approval-gate > p { margin: 0 0 5px; color: #aebdb0; font-size: 11px; line-height: 1.5; }
.review-primary-approval { width: 100%; min-height: 46px; margin-top: 3px; border-color: var(--ok); background: var(--ok); color: #0a1710; font-size: 12px; font-weight: 800; }
.review-primary-approval:focus-visible { outline: 3px solid color-mix(in srgb, var(--ok) 48%, transparent); outline-offset: 3px; }
.review-approval-separation { padding: 12px; border: 1px solid var(--warn); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.review-approval-separation p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }

.review-revision-request,
.review-danger-zone { margin: 11px 0 0; border: 1px solid var(--line); background: var(--bg3); }
.review-revision-request > summary,
.review-danger-zone > summary { padding: 13px 14px; color: var(--fg); font-size: 11px; font-weight: 750; list-style-position: inside; }
.review-revision-request[open] > summary,
.review-danger-zone[open] > summary { border-bottom: 1px solid var(--line); }
.review-revision-request > div,
.review-danger-zone > div { padding: 14px; }
.review-revision-request textarea,
.review-danger-zone textarea { box-sizing: border-box; width: 100%; resize: vertical; }
.review-artifact-actions .review-revision-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 0; }
.review-artifact-actions .review-revision-choices article { align-content: start; border-radius: 0; }
.review-artifact-actions .review-revision-choices button { align-self: end; margin-top: 4px; }
.review-danger-zone { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.review-danger-zone > summary { color: color-mix(in srgb, var(--err) 76%, var(--fg)); }
.review-danger-zone p { margin: 0 0 12px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.review-danger-zone .reject { width: 100%; min-height: 38px; margin-top: 9px; border-color: var(--err); background: color-mix(in srgb, var(--err) 22%, var(--bg3)); color: var(--fg); font-weight: 700; }

@media (max-width: 760px) {
  .production-board,
  .needs-page { padding: 18px 14px 52px; }
  .production-head { margin-bottom: 16px; }
  .production-head p:not(.production-eyebrow) { font-size: 12px; }
  .board-controls { align-items: stretch; flex-direction: column; }
  .board-controls select { width: 100%; }
  .kanban { min-height: 470px; grid-template-columns: repeat(6, minmax(82vw, 1fr)); }
  .kanban-column { max-height: calc(100vh - 300px); }
  .needs-card {
    grid-template-columns: 3px minmax(0, 1fr);
    padding-bottom: 12px;
  }
  .needs-card .review-open { grid-column: 2; justify-self: start; }
  .review-drawer { width: 100vw; }
  .review-drawer-head { padding: 16px; }
  .review-drawer-scroll { padding: 13px 13px 38px; }
  .review-context-summary dl { grid-template-columns: 1fr; }
  .review-structure-evidence dl,
  .review-artifact-actions .review-revision-choices { grid-template-columns: 1fr; }
  .review-structure-evidence header { align-items: flex-start; flex-direction: column; gap: 5px; }
  .review-preview-grid { grid-template-columns: 1fr; }
  .review-artifacts a { grid-template-columns: 90px minmax(0, 1fr); }
  .review-artifacts b { grid-column: 1 / -1; }
  .review-history li { grid-template-columns: 1fr; }
  .review-decision-buttons { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .kanban-card,
  .review-scrim,
  .review-drawer { transition: none; }
}
