﻿/* Qzone HQ — six-department Cairo isometric canvas (v0.1) */

body:has(#qzoneHqSixdeptApp) {
  margin: 0;
  overflow: hidden;
  background: #e8e0cc;
}

.qzone-hq-sixdept {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #e8e0cc;
  font-family: "Consolas", "Courier New", monospace;
}

.qzone-hq-sixdept__hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 8px;
  background: #d8d0bc;
  border-bottom: 1px solid #b8b0a0;
  box-sizing: border-box;
  pointer-events: none;
}

.qzone-hq-sixdept__hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.qzone-hq-sixdept__hud-pill--gold {
  color: #5a4800;
  background: #f0d878;
}

.qzone-hq-sixdept__hud-pill--green {
  color: #104010;
  background: #98d888;
}

.qzone-hq-sixdept__hud-pill--red {
  color: #601010;
  background: #f0a0a0;
}

.qzone-hq-sixdept__hud-pill--blue {
  color: #103060;
  background: #98b8f0;
}

.qzone-hq-sixdept__hud-pill--purple {
  color: #401060;
  background: #c8a8e8;
}

.qzone-hq-sixdept__hud-pill--yellow {
  color: #504000;
  background: #f0e080;
}

.qzone-hq-sixdept__hud-pill--brown {
  color: #402810;
  background: #c8a878;
}

.qzone-hq-sixdept__viewport {
  position: absolute;
  inset: 24px 0 0;
  overflow: hidden;
  cursor: default;
  touch-action: none;
}

.qzone-hq-sixdept__viewport.is-dragging {
  cursor: grabbing;
}

.qzone-hq-sixdept__canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ── Agent character card layer ── */

.qzone-agent-card-layer {
  position: absolute;
  inset: 24px 0 0;
  pointer-events: none;
  z-index: 50;
}

.qzone-agent-card {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  border: 1px solid #333333;
  border-radius: 4px;
  overflow: hidden;
  background: #f0ebe0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  font-family: "Consolas", "Courier New", monospace;
}

.qzone-agent-card__header {
  padding: 4px 8px;
  color: #ffffff;
}

.qzone-agent-card__title {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
}

.qzone-agent-card__subtitle {
  font-size: 8px;
  opacity: 0.92;
  margin-top: 1px;
}

.qzone-agent-card__body {
  padding: 6px 8px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qzone-agent-card__row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qzone-agent-card__label {
  flex: 0 0 28px;
  font-size: 8px;
  color: #444444;
}

.qzone-agent-card__bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: #d0d0c8;
  border: 1px solid #333333;
  overflow: hidden;
}

.qzone-agent-card__bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.15s ease, background 0.15s ease;
}

.qzone-agent-card__footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 2px;
}

.qzone-agent-card__pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 7px;
  font-weight: 700;
  color: #ffffff;
  background: #b0b0a0;
}

.qzone-agent-card__pill--working {
  color: #ffffff;
}

.qzone-agent-card__pill--tired {
  background: #e83030;
}

.qzone-agent-card__skills {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 2px;
}

.qzone-agent-card__skill {
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 7px;
  background: #d8d0c0;
  border: 1px solid #999999;
  color: #333333;
}

.qzone-agent-card__task {
  font-size: 7px;
  color: #555555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.qzone-agent-card__actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.qzone-agent-card__btn {
  flex: 1;
  padding: 3px 0;
  font-size: 8px;
  font-weight: 700;
  font-family: inherit;
  border: 1px solid #333333;
  border-radius: 3px;
  cursor: pointer;
  background: #e8e0cc;
  color: #222222;
}

.qzone-agent-card__btn--dispatch {
  background: #50b840;
  color: #ffffff;
}

.qzone-agent-card__btn--rest {
  background: #4888d8;
  color: #ffffff;
}

.qzone-agent-card__btn.is-disabled,
.qzone-agent-card__btn:disabled {
  background: #b0b0a0;
  color: #666666;
  cursor: not-allowed;
  border-color: #888888;
}

/* ── Owner Cockpit｜中文唯讀投影 ── */

.qzone-owner-cockpit {
  position: fixed;
  top: 36px;
  right: 12px;
  bottom: 12px;
  z-index: 120;
  width: min(520px, calc(100vw - 24px));
  overflow: auto;
  box-sizing: border-box;
  padding: 18px;
  color: #20251f;
  background: rgba(250, 248, 240, 0.97);
  border: 1px solid #92866d;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(50, 42, 25, 0.25);
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

.qzone-owner-cockpit__header,
.qzone-owner-cockpit__item-heading,
.qzone-owner-cockpit__loader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.qzone-owner-cockpit__header h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.qzone-owner-cockpit__eyebrow {
  margin: 0;
  color: #706448;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.qzone-owner-cockpit__readonly {
  flex: 0 0 auto;
  padding: 5px 9px;
  color: #155b45;
  background: #d7efe5;
  border: 1px solid #91c9b5;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.qzone-owner-cockpit__notice {
  margin: 12px 0;
  padding: 10px 12px;
  color: #554b38;
  background: #f1ead8;
  border-left: 4px solid #b28b35;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.qzone-owner-cockpit__loader {
  margin-bottom: 10px;
  padding: 10px;
  background: #ffffff;
  border: 1px dashed #a79a7f;
  border-radius: 10px;
}

.qzone-owner-cockpit__file-label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: #ffffff;
  background: #345a48;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.qzone-owner-cockpit__file-label:focus-within {
  outline: 3px solid rgba(52, 90, 72, 0.3);
  outline-offset: 2px;
}

.qzone-owner-cockpit__file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.qzone-owner-cockpit__loader-hint {
  color: #706a5b;
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

.qzone-owner-cockpit__status {
  margin: 8px 0 12px;
  padding: 8px 10px;
  color: #5d5036;
  background: #efe8d6;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}

.qzone-owner-cockpit__status.is-ready {
  color: #155b45;
  background: #dff2e9;
}

.qzone-owner-cockpit__status.is-blocked {
  color: #7a2e25;
  background: #f8ded8;
}

.qzone-owner-cockpit__summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.qzone-owner-cockpit__summary-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 6px;
  background: #ffffff;
  border: 1px solid #d7cfbe;
  border-radius: 10px;
  text-align: center;
}

.qzone-owner-cockpit__summary-card strong {
  font-size: 21px;
}

.qzone-owner-cockpit__summary-card span {
  color: #696252;
  font-size: 10px;
}

.qzone-owner-cockpit__provenance,
.qzone-owner-cockpit__meta {
  margin: 10px 0 0;
}

.qzone-owner-cockpit__provenance {
  padding: 10px;
  background: #e9eef0;
  border-radius: 10px;
}

.qzone-owner-cockpit__next-best-action {
  margin-top: 12px;
  padding: 14px;
  background: #fffdf7;
  border: 1px solid #b9aa87;
  border-left: 5px solid #345a48;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(62, 50, 25, 0.1);
}

.qzone-owner-cockpit__next-best-header,
.qzone-owner-cockpit__next-best-identity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.qzone-owner-cockpit__next-best-title {
  margin: 0;
  color: #24372f;
  font-size: 16px;
  line-height: 1.35;
}

.qzone-owner-cockpit__derivation {
  flex: 0 0 auto;
  padding: 3px 7px;
  color: #345144;
  background: #e2eee8;
  border: 1px solid #a9c7ba;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
}

.qzone-owner-cockpit__derivation.is-local {
  color: #624a13;
  background: #f6edcf;
  border-color: #d6bd70;
}

.qzone-owner-cockpit__next-best-identity {
  margin-top: 12px;
}

.qzone-owner-cockpit__next-best-identity strong {
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.qzone-owner-cockpit__recommendation,
.qzone-owner-cockpit__next-best-explanation,
.qzone-owner-cockpit__next-best-empty {
  margin: 9px 0 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.qzone-owner-cockpit__recommendation {
  padding: 10px;
  color: #174f3d;
  background: #e5f2ec;
  border-radius: 8px;
}

.qzone-owner-cockpit__recommendation span,
.qzone-owner-cockpit__next-best-explanation {
  color: #625a49;
}

.qzone-owner-cockpit__next-best-empty {
  padding: 12px;
  color: #665d49;
  background: #f4efe2;
  border: 1px dashed #c7b996;
  border-radius: 8px;
}

.qzone-owner-cockpit__meta-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  margin: 4px 0;
  font-size: 11px;
  line-height: 1.5;
}

.qzone-owner-cockpit__meta-row dt {
  color: #6f6859;
  font-weight: 700;
}

.qzone-owner-cockpit__meta-row dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.qzone-owner-cockpit__section {
  margin-top: 16px;
}

.qzone-owner-cockpit__section h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 8px;
  color: #2d332c;
  font-size: 15px;
}

.qzone-owner-cockpit__section-count {
  min-width: 18px;
  padding: 2px 5px;
  color: #ffffff;
  background: #6b715f;
  border-radius: 999px;
  font-size: 10px;
  text-align: center;
}

.qzone-owner-cockpit__list {
  display: grid;
  gap: 8px;
}

.qzone-owner-cockpit__item {
  padding: 12px;
  background: #ffffff;
  border: 1px solid #d7cfbe;
  border-radius: 10px;
}

.qzone-owner-cockpit__item-heading strong {
  font-size: 14px;
}

.qzone-owner-cockpit__priority {
  padding: 2px 6px;
  color: #ffffff;
  background: #6f7568;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.qzone-owner-cockpit__priority--p0 {
  background: #a33d31;
}

.qzone-owner-cockpit__priority--p1 {
  background: #7a4d00;
}

.qzone-owner-cockpit__priority--p2 {
  background: #3d6f91;
}

.qzone-owner-cockpit__goal,
.qzone-owner-cockpit__state,
.qzone-owner-cockpit__blocker,
.qzone-owner-cockpit__next {
  margin: 7px 0 0;
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.qzone-owner-cockpit__goal {
  color: #665d49;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 10px;
}

.qzone-owner-cockpit__blocker {
  padding: 7px 8px;
  color: #7a2e25;
  background: #fbe7e2;
  border-radius: 7px;
}

.qzone-owner-cockpit__next span {
  color: #6e6658;
}

.qzone-owner-cockpit__empty {
  margin: 0;
  padding: 10px;
  color: #777064;
  background: rgba(255, 255, 255, 0.65);
  border: 1px dashed #c2b8a4;
  border-radius: 8px;
  font-size: 12px;
}

.qzone-owner-cockpit__question {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fffdf6;
  border: 1px solid #e4d8be;
  border-radius: 12px;
}

.qzone-owner-cockpit__question h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.qzone-owner-cockpit__question-body p,
.qzone-owner-cockpit__now-line {
  margin: 0 0 8px;
  line-height: 1.55;
}

.qzone-owner-cockpit__issue-board {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #d7ccb4;
}

.qzone-owner-cockpit__issue-board h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.qzone-owner-cockpit__issue-status {
  margin: 0 0 10px;
  color: #706448;
  font-size: 13px;
}

.qzone-owner-cockpit__issue-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.qzone-owner-cockpit__issue-group {
  margin: 12px 0 6px;
  color: #554b38;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.qzone-owner-cockpit__issue-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #fffdf6;
  border: 1px solid #e4d8be;
  border-radius: 10px;
}

.qzone-owner-cockpit__issue-link {
  color: #2b4638;
  font-weight: 700;
  text-decoration: none;
}

.qzone-owner-cockpit__issue-link:hover {
  text-decoration: underline;
}

.qzone-owner-cockpit__issue-meta {
  color: #8a5a22;
  font-size: 12px;
  font-weight: 700;
}

.qzone-owner-cockpit__empty--large {
  padding: 22px 12px;
  line-height: 1.6;
  text-align: center;
}

@media (max-width: 760px) {
  .qzone-owner-cockpit {
    top: 30px;
    right: 6px;
    bottom: 6px;
    width: calc(100vw - 12px);
    padding: 14px;
    border-radius: 12px;
  }

  .qzone-owner-cockpit__summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .qzone-owner-cockpit__loader {
    align-items: flex-start;
    flex-direction: column;
  }

  .qzone-owner-cockpit__loader-hint {
    text-align: left;
  }

  .qzone-owner-cockpit__meta-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .qzone-owner-cockpit__next-best-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
