/* Document Intelligence — workspace layout (extends doc-intel-hub.css) */

html, body.ws-page { height: 100%; overflow: hidden; }

.ws-shell {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 46px - 120px - 46px);
  min-height: 480px;
  background: var(--paper);
}

.ws-statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink3);
}

.ws-statusbar-left,
.ws-statusbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ws-session { letter-spacing: 0.06em; color: var(--ink2); }

.ws-main {
  flex: 1;
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  overflow: hidden;
}

.ws-panel {
  border-right: 1px solid var(--rule);
  background: var(--paper2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.ws-panel-right {
  border-right: none;
  border-left: 1px solid var(--rule);
}

.ws-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}

.ws-label {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

/* Pipeline phases */
.ws-phases { display: flex; flex-direction: column; gap: 4px; }

.ws-phase {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: border-color 0.15s, background 0.15s;
}

.ws-phase.active {
  background: var(--gold-bg);
  border-color: var(--gold-bd);
}

.ws-phase.done { opacity: 0.55; }

.ws-phase-num {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--ink3);
  border: 1px solid var(--rule);
  background: var(--surface);
}

.ws-phase.active .ws-phase-num {
  color: var(--paper);
  background: var(--gold);
  border-color: var(--gold);
}

.ws-phase.done .ws-phase-num {
  color: var(--green);
  border-color: rgba(52, 211, 153, 0.3);
}

.ws-phase-name {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.ws-phase-detail {
  font-size: 10px;
  color: var(--ink3);
  line-height: 1.4;
}

/* Agent roster */
.ws-agents { display: flex; flex-direction: column; gap: 2px; }

.ws-agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 2px;
}

.ws-agent:hover { background: rgba(255, 255, 255, 0.02); }

.ws-agent-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ws-agent-code {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  width: 44px;
  flex-shrink: 0;
}

.ws-agent-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.2;
}

.ws-agent-role {
  font-size: 9px;
  color: var(--ink3);
}

/* Chat area */
.ws-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
}

.ws-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ws-msg {
  display: flex;
  gap: 12px;
  max-width: 780px;
  animation: wsFade 0.25s ease;
}

@keyframes wsFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.ws-msg.user { flex-direction: row-reverse; align-self: flex-end; }

.ws-msg-avatar {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--gold);
}

.ws-msg.user .ws-msg-avatar {
  color: var(--ink2);
  background: var(--paper2);
}

.ws-msg-body { flex: 1; min-width: 0; }

.ws-msg-sender {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink3);
  margin-bottom: 4px;
}

.ws-msg.user .ws-msg-sender { text-align: right; }

.ws-msg-bubble {
  padding: 12px 14px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  border: 1px solid var(--rule);
  background: var(--surface);
}

.ws-msg.doc .ws-msg-bubble { border-left: 2px solid var(--gold); }

.ws-msg.user .ws-msg-bubble {
  background: var(--paper2);
  border-color: var(--rule2);
}

.ws-msg-bubble strong { color: var(--gold2); font-weight: 600; }

.ws-agent-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  margin-bottom: 6px;
  color: var(--gold);
  border: 1px solid var(--gold-bd);
  background: var(--gold-bg);
}

/* Request card */
.ws-req-card {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--rule);
  background: var(--paper2);
}

.ws-req-title {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}

.ws-req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 11px;
  color: var(--ink2);
}

.ws-req-label {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink3);
  width: 28px;
  flex-shrink: 0;
}

.ws-req-name { flex: 1; }

.ws-req-status {
  font-family: var(--mono);
  font-size: 7px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 5px;
}

.ws-upload-btn {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--gold-bd);
  background: var(--gold-bg);
  color: var(--gold);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ws-upload-btn:hover {
  background: var(--gold);
  color: var(--paper);
}

/* Quick replies */
.ws-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ws-quick button {
  font-family: var(--mono);
  font-size: 9px;
  padding: 6px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink2);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.ws-quick button:hover {
  border-color: var(--gold-bd);
  color: var(--gold);
}

/* Input bar */
.ws-input-area {
  padding: 12px 24px 16px;
  border-top: 1px solid var(--rule);
  background: var(--surface);
  flex-shrink: 0;
}

.ws-input-wrap {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.ws-input {
  flex: 1;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13px;
  resize: none;
  outline: none;
  min-height: 44px;
  max-height: 160px;
  line-height: 1.5;
}

.ws-input:focus { border-color: var(--gold-bd); }

.ws-input::placeholder { color: var(--ink3); }

.ws-btn {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0 14px;
  height: 44px;
  border: 1px solid var(--rule);
  background: var(--paper2);
  color: var(--ink2);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}

.ws-btn:hover { border-color: var(--gold-bd); color: var(--gold); }

.ws-btn-send {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}

.ws-btn-send:hover {
  background: var(--gold2);
  border-color: var(--gold2);
  color: var(--paper);
}

.ws-btn-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ws-input-hint {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink3);
  text-align: center;
  letter-spacing: 0.04em;
}

/* Upload zone */
.ws-drop {
  margin: 0;
  border: 1px dashed var(--rule2);
  padding: 20px 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--surface);
}

.ws-drop:hover,
.ws-drop.drag-over {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.ws-drop-label {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.ws-drop-sub {
  font-size: 10px;
  color: var(--ink3);
  line-height: 1.5;
}

.ws-drop input[type="file"] { display: none; }

/* Activity log */
.ws-activity {
  flex: 1;
  overflow-y: auto;
  padding: 0 16px 16px;
}

.ws-act-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink3);
  line-height: 1.45;
}

.ws-act-time {
  flex-shrink: 0;
  color: var(--ink3);
  opacity: 0.7;
  width: 52px;
}

.ws-act-text { color: var(--ink2); }
.ws-act-text strong { color: var(--ink); font-weight: 500; }

/* Vault */
.ws-vault-empty {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink3);
  line-height: 1.6;
  font-style: normal;
}

.ws-vault-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin-bottom: 4px;
  border: 1px solid var(--rule);
  background: var(--surface);
}

.ws-vault-ext {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  color: var(--gold);
  width: 32px;
  flex-shrink: 0;
}

.ws-vault-name {
  font-size: 10px;
  color: var(--ink);
  word-break: break-all;
}

.ws-vault-meta {
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink3);
}

/* Context meter */
.ws-meter-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 8px;
  color: var(--ink3);
  margin-bottom: 4px;
}

.ws-meter-bar {
  height: 2px;
  background: var(--rule);
  overflow: hidden;
}

.ws-meter-fill {
  height: 100%;
  background: var(--gold);
  width: 0.5%;
  transition: width 0.4s ease;
}

/* Drop overlay */
.ws-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 8, 16, 0.88);
  border: 2px dashed var(--gold);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
}

.ws-overlay.active { display: flex; }

.ws-overlay-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
}

.ws-overlay-sub {
  font-size: 12px;
  color: var(--ink3);
}

/* Typing indicator */
.ws-typing span {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 3px;
  background: var(--ink3);
  animation: wsDot 1.2s ease-in-out infinite;
}

.ws-typing span:nth-child(2) { animation-delay: 0.15s; }
.ws-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes wsDot {
  0%, 60%, 100% { opacity: 0.3; }
  30% { opacity: 1; }
}

.ws-new-session {
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink3);
  cursor: pointer;
}

.ws-new-session:hover {
  border-color: var(--gold-bd);
  color: var(--gold);
}

/* Scrollbars */
.ws-panel::-webkit-scrollbar,
.ws-messages::-webkit-scrollbar,
.ws-activity::-webkit-scrollbar { width: 3px; }

.ws-panel::-webkit-scrollbar-thumb,
.ws-messages::-webkit-scrollbar-thumb,
.ws-activity::-webkit-scrollbar-thumb { background: var(--rule); }

@media (max-width: 1100px) {
  .ws-main { grid-template-columns: 220px 1fr 0; }
  .ws-panel-right { display: none; }
}

@media (max-width: 768px) {
  .ws-shell { height: calc(100vh - 46px - 140px - 46px); }
  .ws-main { grid-template-columns: 0 1fr 0; }
  .ws-panel:first-child { display: none; }
  .ws-messages { padding: 14px 16px; }
  .ws-input-area { padding: 10px 16px 14px; }
}
