.office-view {
  margin: 20px 0;
  padding: 24px;
  overflow: hidden;
}

.office-title {
  margin-bottom: 12px;
}

.office-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 10px;
}

.office-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.office-legend strong {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-dot.working {
  background: var(--aqua);
  box-shadow: 0 0 10px #61f2c4aa;
}

.legend-dot.review {
  background: var(--gold);
  box-shadow: 0 0 10px #ffc85788;
}

.office-floor {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-template-areas:
    "support support coordinator coordinator noc noc"
    "developer developer hub hub qa qa";
  gap: 18px;
  min-height: 520px;
  padding: 28px;
  border: 1px solid #35514c;
  border-radius: 18px;
  background:
    linear-gradient(90deg, #ffffff08 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(#ffffff08 1px, transparent 1px) 0 0 / 36px 36px,
    radial-gradient(circle at 50% 52%, #61f2c413 0 12%, transparent 13%),
    #0a1716;
  position: relative;
}

.office-floor::before {
  content: "";
  position: absolute;
  inset: 50% 7% auto;
  border-top: 1px dashed #3e5a55;
  pointer-events: none;
}

.office-floor::after {
  content: "";
  position: absolute;
  inset: 7% 50% 7% auto;
  border-left: 1px dashed #3e5a55;
  pointer-events: none;
}

.office-floor .agent {
  min-height: 196px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: linear-gradient(145deg, #102321f2, #091413f2);
  box-shadow: 0 12px 30px #0007;
}

.office-floor .agent[data-agent="coordinator"] { grid-area: coordinator; }
.office-floor .agent[data-agent="support"] { grid-area: support; }
.office-floor .agent[data-agent="noc"] { grid-area: noc; }
.office-floor .agent[data-agent="developer"] { grid-area: developer; }
.office-floor .agent[data-agent="qa"] { grid-area: qa; }

.office-floor .agent.active,
.office-floor .agent.state-working {
  border-color: var(--aqua);
  box-shadow: 0 0 0 1px #61f2c43d, 0 14px 36px #0009, 0 0 32px #61f2c421;
}

.office-floor .agent.state-needs_review {
  border-color: var(--gold);
}

.office-floor .agent::before {
  width: 105px;
  height: 105px;
}

.office-floor .agent-head {
  align-items: flex-start;
}

.office-floor .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #071110;
  position: relative;
  box-shadow: 0 0 0 5px #61f2c40d;
}

.office-floor .avatar::after {
  content: "";
  position: absolute;
  width: 74px;
  height: 9px;
  left: 50%;
  top: 53px;
  transform: translateX(-50%);
  border: 1px solid #3e5a55;
  border-radius: 4px;
  background: #1a2d2a;
  box-shadow: 0 7px 0 -3px #3e5a55;
}

.office-floor .agent-state {
  max-width: 130px;
  text-align: right;
}

.office-floor .agent strong {
  margin-top: 24px;
  font-size: 16px;
}

.office-floor .agent small {
  display: block;
}

.office-floor .agent p {
  margin: 7px 0 0;
}

.office-floor .agent-detail {
  min-height: 45px;
  font-size: 11px;
}

.office-hub {
  grid-area: hub;
  align-self: center;
  justify-self: stretch;
  z-index: 1;
  border: 1px dashed #486860;
  border-radius: 999px;
  padding: 15px 12px;
  background: #071110e8;
  text-align: center;
}

.office-hub strong {
  display: block;
  color: var(--aqua);
  font: 700 11px ui-monospace, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.office-hub span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.office-truth {
  margin: 13px 2px 0;
  color: var(--muted);
  font-size: 11px;
}

.office-truth strong {
  color: var(--aqua);
}

.next-action {
  margin: 0 0 20px;
  padding: 24px;
  border-color: #3f665d;
}

.next-action.attention {
  border-color: var(--gold);
  box-shadow: 0 0 32px #ffc85712;
}

.next-action.ready {
  border-color: var(--aqua);
  box-shadow: 0 0 32px #61f2c414;
}

.next-action-content {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 20px;
  align-items: start;
}

.next-action-content h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.next-action-content p,
.next-action-content li {
  color: var(--muted);
  font-size: 12px;
}

.next-action-content ol {
  margin: 12px 0 0;
  padding-left: 20px;
}

.next-action-content li {
  padding: 3px 0;
}

.next-action-example {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #071110;
  padding: 14px;
}

.next-action-example strong {
  display: block;
  margin-bottom: 8px;
  color: var(--aqua);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.next-action-example code {
  display: block;
  color: var(--ink);
  white-space: normal;
  overflow-wrap: anywhere;
}

.next-action-warning {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--gold);
  background: #ffc8570a;
}

.next-action-link {
  display: inline-block;
  margin-top: 8px;
  border: 1px solid var(--aqua);
  border-radius: 9px;
  padding: 8px 11px;
  color: var(--aqua);
  text-decoration: none;
  font-size: 11px;
  font-weight: 700;
}

.work-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.work-summary article.archive {
  border-style: dashed;
}

.work-summary article.archive strong {
  color: var(--muted);
}

@media (max-width: 900px) {
  .next-action-content {
    grid-template-columns: 1fr;
  }

  .next-action-warning {
    grid-column: auto;
  }

  .work-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .office-floor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "coordinator coordinator"
      "support noc"
      "developer qa"
      "hub hub";
    min-height: auto;
  }

  .office-floor::before,
  .office-floor::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .next-action {
    padding: 18px;
  }

  .work-summary {
    grid-template-columns: 1fr;
  }

  .office-view {
    padding: 15px;
  }

  .office-floor {
    grid-template-columns: 1fr;
    grid-template-areas:
      "coordinator"
      "support"
      "noc"
      "developer"
      "qa"
      "hub";
    gap: 12px;
    padding: 14px;
  }

  .office-floor .agent {
    min-height: 170px;
  }

  .office-legend strong {
    width: 100%;
    margin-left: 0;
  }
}

/* Keep long source excerpts from pushing the review controls off-screen. */
.result-grid {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr);
  align-items: start;
}

.result-grid > div,
.result-details,
.result-review,
.evidence {
  min-width: 0;
}

.evidence article {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.evidence p,
.evidence code {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.result-review {
  position: sticky;
  top: 92px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: #0a1716;
  padding: 18px;
  box-shadow: 0 16px 40px #0005;
}

.review-help {
  color: var(--muted);
  font-size: 12px;
}

.review-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.review-actions button {
  min-height: 44px;
}

.review-actions .approve {
  font-weight: 800;
}

@media (max-width: 900px) {
  .result-grid {
    grid-template-columns: 1fr;
  }

  .result-review {
    position: static;
    order: -1;
  }
}

@media (max-width: 560px) {
  .review-actions {
    grid-template-columns: 1fr;
  }

  .result-review {
    padding: 14px;
  }
}
