.queue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.status.manual {
  color: var(--green);
}

.horizon-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin:8px 0 2px; }
.horizon-tools button.active { background:var(--green); color:white; border-color:var(--green); }
.horizon-tools span { color:var(--muted); font-size:12px; flex:1 1 220px; }
.preview-wrap.marking canvas { cursor:crosshair; }
.preview-wrap.marking { box-shadow:inset 0 0 0 2px var(--green); }
.preview-wrap.marking canvas.dragging-point { cursor:grabbing; }
.preview-fullscreen { position:absolute; z-index:5; left:50%; top:30px; bottom:auto; transform:translateX(-50%); background:rgba(12,28,21,.78); backdrop-filter:blur(5px); white-space:nowrap; }
.fullscreen-tip { display:none; position:absolute; z-index:5; left:50%; bottom:18px; transform:translateX(-50%); color:white; background:rgba(12,28,21,.78); border-radius:20px; padding:7px 14px; font-size:12px; pointer-events:none; white-space:nowrap; }
.preview-wrap:fullscreen { width:100vw; height:100vh; padding:54px 18px; background:#07100c; }
.preview-wrap:fullscreen canvas { width:min(calc(100vw - 36px), calc((100vh - 108px) * 2)); height:auto; max-height:calc(100vh - 108px); }
.preview-wrap:fullscreen .fullscreen-tip { display:block; }
.preview-wrap:fullscreen .preview-fullscreen { left:50%; top:200px; bottom:auto; transform:translateX(-50%); }
.preview-wrap:fullscreen .horizon { left:50%; width:min(calc(100vw - 36px), calc((100vh - 108px) * 2)); right:auto; transform:translateX(-50%); }
.preview-grid { position:absolute; z-index:2; inset:0; pointer-events:none; background:linear-gradient(to bottom, transparent calc(50% - .5px), rgba(255,255,255,.7) calc(50% - .5px), rgba(255,255,255,.7) calc(50% + .5px), transparent calc(50% + .5px)),linear-gradient(to right, transparent calc(20% - .5px), rgba(255,255,255,.7) calc(20% - .5px), rgba(255,255,255,.7) calc(20% + .5px), transparent calc(20% + .5px), transparent calc(40% - .5px), rgba(255,255,255,.7) calc(40% - .5px), rgba(255,255,255,.7) calc(40% + .5px), transparent calc(40% + .5px), transparent calc(60% - .5px), rgba(255,255,255,.7) calc(60% - .5px), rgba(255,255,255,.7) calc(60% + .5px), transparent calc(60% + .5px), transparent calc(80% - .5px), rgba(255,255,255,.7) calc(80% - .5px), rgba(255,255,255,.7) calc(80% + .5px), transparent calc(80% + .5px)); }
.preview-wrap:fullscreen .preview-grid { inset:auto; left:50%; top:50%; width:min(calc(100vw - 36px), calc((100vh - 108px) * 2)); aspect-ratio:2/1; transform:translate(-50%,-50%); }
.mode-panel { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 18px; margin-bottom:16px; }
.mode-panel>div:first-child { display:flex; flex-direction:column; }
.mode-panel span { color:var(--muted); font-size:12px; }
.row-file-name { display:flex; align-items:center; gap:6px; min-width:0; margin-bottom:6px; overflow:hidden; color:var(--ink); font-weight:700; text-overflow:ellipsis; }
.row-file-name em { flex:none; padding:1px 5px; border-radius:8px; background:#fff0d7; color:#935e0a; font-size:9px; font-style:normal; }
.row-mode-switch { display:inline-flex; align-items:center; padding:2px; border:1px solid var(--line); border-radius:8px; background:#f3f6f4; }
.row-mode-switch button { min-width:38px; padding:3px 7px; border-radius:6px; background:transparent; color:var(--muted); font-size:10px; }
.row-mode-switch button.active { background:var(--green); color:white; }
.unconfirmed .row-mode-switch { border-color:#d9a34f; background:#fff8eb; }
.unconfirmed .row-mode-switch button.active { background:#b97814; }
.row-status-footer { display:flex; align-items:center; gap:8px; margin-top:6px; }
.row-status-footer .row-progress { flex:1 1 auto; min-width:34px; margin:0; }
.row-status-footer .calculate-one, .row-status-footer .confirm-mode { flex:none; padding:4px 8px; border-radius:6px; color:white; font-size:10px; line-height:1.25; }
.row-status-footer .calculate-one { background:#2769d8; }
.row-status-footer .confirm-mode { background:#b97814; }
.row-status-footer .calculate-one:disabled, .row-status-footer .confirm-mode:disabled { opacity:.4; }
body.ground-mode .horizon-tools, body.ground-mode .fullscreen-tip, body.ground-mode .horizon { display:none!important; }
.mode-badge { display:block; width:max-content; margin-bottom:4px; padding:2px 7px; border-radius:10px; background:#e4f3e9; color:var(--green); font-size:10px; font-weight:800; }
.mode-badge.uncertain { background:#fff0d7; color:#935e0a; }
.status.needs-confirmation, .needs-confirmation { color:#a96910; }

/* Desktop workbench: the image editor stays visible while the queue scrolls. */
.workbench {
  display: grid;
  grid-template-columns: minmax(520px, 1.35fr) minmax(440px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.workbench .editor {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

.workbench .preview-wrap {
  min-height: 0;
  aspect-ratio: 2 / 1;
}

.workbench .controls {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.workbench .selected {
  margin-bottom: 10px;
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
}

.control-grid .yaw-control {
  grid-column: 1 / -1;
}

.workbench .controls label {
  margin: 10px 0;
}

.workbench .control-actions {
  margin-top: 8px;
}

.workbench .queue {
  min-width: 0;
  height: 650px;
  display: flex;
  flex-direction: column;
}

.workbench .queue-head {
  align-items: flex-start;
  gap: 12px;
}

.workbench .queue-actions {
  flex-direction: column;
  flex-wrap: nowrap;
  min-width: 148px;
}

.workbench .queue-actions button {
  width: 100%;
}

.workbench .table-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
}

.workbench table {
  table-layout: fixed;
}

.workbench th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--line);
}

.workbench th:nth-child(1) { width: 27%; }
.workbench th:nth-child(2) { width: 39%; }
.workbench th:nth-child(3) { width: 21%; }
.workbench th:nth-child(4) { width: 13%; }

.workbench th,
.workbench td {
  padding: 10px 11px;
}

.workbench td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.workbench .status {
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
}

.workbench .row-progress {
  width: 100%;
  max-width: 150px;
}

.angle-stack {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.angle-stack small {
  color: var(--muted);
  font-size: 11px;
}

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

  .workbench .queue {
    height: 480px;
  }

  .workbench .queue-actions {
    flex-direction: row;
  }
}

@media (max-width: 650px) {
  .control-grid {
    display: block;
  }

  .workbench .queue {
    height: 440px;
  }

  .workbench .queue-head {
    align-items: stretch;
    flex-direction: column;
  }

  .workbench .queue-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}
