/* L11 — Multi-agent hypothesis-driven UI styles */

.l11-dashboard { display: flex; flex-direction: column; gap: 18px; padding: 8px 0; }
.l11-dashboard-wrapper { min-height: 200px; }
.l11-loading {
  text-align: center; padding: 30px; color: var(--text-hint);
  font-size: 13px;
}
.l11-empty {
  padding: 16px; background: var(--bg-elevated); border-radius: 6px;
  color: var(--text-hint); font-size: 13px; line-height: 1.5;
}

.l11-panel {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--bg-base);
}
.l11-panel__title {
  margin: 0 0 10px 0; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* Hypothesis cards */
.l11-hyp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.l11-hyp-card {
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--bg-elevated);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s;
}
.l11-hyp-card:hover { border-color: var(--accent); }
.l11-hyp-card--primary { border-left: 3px solid #2196f3; }
.l11-hyp-card--alternative { border-left: 3px solid #ff9800; }
.l11-hyp-card--null_hypothesis { border-left: 3px solid #9e9e9e; }

.l11-hyp-card__header {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.l11-hyp-card__type {
  font-size: 10px; font-weight: 700; letter-spacing: 0.6px;
  color: var(--text-secondary);
}
.l11-hyp-card__by { font-size: 13px; }
.l11-hyp-card__badge {
  font-size: 10px; padding: 1px 6px; border-radius: 3px;
  background: var(--bg-base); color: var(--text-hint);
}
.l11-hyp-card__badge--edited { background: #fff3cd; color: #856404; }

.l11-hyp-card__statement {
  font-size: 13px; line-height: 1.45; color: var(--text-primary);
  margin: 4px 0;
}
.l11-hyp-card__meta {
  font-size: 11px; line-height: 1.4; color: var(--text-secondary);
}
.l11-hyp-card__meta-label {
  font-weight: 600; color: var(--text-primary);
}
.l11-hyp-card__evidence {
  display: flex; gap: 6px; margin-top: 4px;
}
.l11-evidence-badge {
  font-size: 10px; padding: 2px 6px; border-radius: 3px;
  font-weight: 600;
}
.l11-evidence-badge--support { background: #d4edda; color: #155724; }
.l11-evidence-badge--contradict { background: #f8d7da; color: #721c24; }
.l11-evidence-badge--neutral { background: #e2e3e5; color: #495057; }

.l11-hyp-card__framing {
  margin-top: 6px; font-size: 11px;
  background: rgba(127, 102, 178, 0.06);
  border-radius: 4px; padding: 4px 8px;
}
.l11-hyp-card__framing summary {
  cursor: pointer; color: #7f66b2; font-weight: 600;
}
.l11-hyp-card__interp {
  margin: 6px 0 0 0; line-height: 1.4; color: var(--text-secondary);
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}
.l11-hyp-card__interp::-webkit-scrollbar { width: 6px; }
.l11-hyp-card__interp::-webkit-scrollbar-thumb {
  background: rgba(127, 102, 178, 0.3); border-radius: 3px;
}

/* Confidence bar */
.l11-conf-bar {
  position: relative;
  flex: 0 0 80px; height: 14px;
  background: var(--bg-base); border-radius: 7px;
  overflow: hidden; margin-left: auto;
  border: 1px solid var(--border-soft);
}
.l11-conf-bar__fill {
  position: absolute; inset: 0; right: auto;
  transition: width 0.3s;
}
.l11-conf-bar__label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-primary);
  text-shadow: 0 0 2px var(--bg-base);
}

/* Panel header (with cancel button) */
.l11-panel__header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.l11-panel__header .l11-panel__title { margin: 0; }
.l11-panel__actions {
  display: flex; align-items: center; gap: 8px;
}
.l11-cancel-btn {
  background: transparent; color: var(--danger, #ef4444);
  border: 1px solid var(--danger, #ef4444);
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  font-size: 11px; font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.l11-cancel-btn:hover { background: var(--danger-tint, #fecaca); color: var(--on-danger, #991b1b); }
.l11-finalize-btn {
  background: var(--color-primary, #079d9d); color: white; border: none;
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
  font-size: 11px; font-weight: 600;
  transition: background 0.15s;
}
.l11-finalize-btn:hover { background: var(--accent-blue-hover, #078a9f); }

/* Agent timeline (4 swim lanes) */
.l11-agent-stack {
  display: flex; flex-direction: column; gap: 4px;
}
.l11-agent-lane {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 4px 0;
}
.l11-agent-lane__ctl {
  display: flex; gap: 2px;
}
.l11-agent-ctl {
  background: var(--bg-elevated); color: var(--text-primary);
  border: 1px solid var(--border-soft); border-radius: 3px;
  padding: 2px 6px; font-size: 11px; cursor: pointer; line-height: 1;
  min-width: 22px;
  transition: background 0.15s;
}
.l11-agent-ctl:hover { background: var(--accent); color: white; border-color: var(--accent); }
.l11-agent-lane__name {
  font-size: 11px; font-weight: 700; color: var(--text-primary);
}
.l11-agent-lane__bar {
  height: 18px; border-radius: 3px;
  display: flex; align-items: center; padding: 0 8px;
  position: relative;
  transition: background 0.3s;
}
.l11-agent-lane__status {
  font-size: 10px; font-weight: 700; color: white;
  text-transform: uppercase; letter-spacing: 0.5px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}
.l11-agent-lane__meta {
  font-size: 10px; color: var(--text-hint);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.l11-lane--pulse .l11-agent-lane__bar {
  animation: l11-pulse 1.4s ease-in-out infinite;
}
@keyframes l11-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* L11 P25 Gantt timeline (per-round segments) */
.l11-gantt {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 11px;
}
.l11-gantt__axis {
  position: relative; height: 16px;
  margin-left: 118px; margin-right: 200px;
  border-bottom: 1px dashed var(--border-soft);
}
.l11-gantt__tick {
  position: absolute; top: 0;
  transform: translateX(-50%);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 10px; color: var(--text-hint);
  white-space: nowrap;
}
.l11-gantt__tick:first-child { transform: translateX(0); }
.l11-gantt__tick:last-child  { transform: translateX(-100%); }
.l11-gantt__body {
  display: flex; flex-direction: column; gap: 4px;
}
.l11-gantt__row {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 8px; align-items: center;
  padding: 2px 0;
}
.l11-gantt__label {
  font-size: 11px; font-weight: 700; color: var(--text-primary);
}
.l11-gantt__track {
  position: relative; height: 22px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.l11-gantt__segment {
  position: absolute; top: 2px; bottom: 2px;
  border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  /* L20 UI polish: segment hẹp → label #N tràn đè segment kế bên */
  overflow: hidden; white-space: nowrap; min-width: 3px;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  white-space: nowrap; overflow: hidden;
  min-width: 4px;
}
.l11-gantt__segment:hover {
  filter: brightness(1.15);
  transform: scaleY(1.1);
  z-index: 2;
}
.l11-gantt__seg-label {
  font-size: 9px; font-weight: 700; color: white;
  text-shadow: 0 1px 1px rgba(0,0,0,0.4);
  letter-spacing: 0.3px;
}
.l11-gantt__segment--pulse {
  animation: l11-pulse 1.4s ease-in-out infinite;
}
.l11-gantt__meta {
  font-size: 10px; color: var(--text-hint);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap;
}

/* Mention chain */
.l11-mention-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 240px; overflow-y: auto;
  /* L20: đồng bộ font với các tab — sans + tabular-nums thay mono */
  font-family: "Noto Sans", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
}
.l11-mention-row {
  display: grid;
  grid-template-columns: 80px 110px 16px 110px 1fr 70px;
  gap: 6px; align-items: center;
  padding: 3px 6px; border-radius: 3px;
}
.l11-mention-row:hover { background: var(--bg-elevated); }
.l11-mention-time { color: var(--text-hint); }
.l11-mention-from { color: var(--text-secondary); font-weight: 600; }
.l11-mention-arrow { color: var(--text-hint); text-align: center; }
.l11-mention-to { color: var(--text-primary); font-weight: 600; }
.l11-mention-cmd {
  color: var(--accent);
  text-transform: uppercase; font-size: 10px; letter-spacing: 0.5px;
}
.l11-mention-status {
  font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 3px;
  text-align: center; text-transform: uppercase;
}
/* L20 UI polish: expired là vòng đời BÌNH THƯỜNG của mention TTL — badge đỏ
   hàng loạt đọc như lỗi. Neutral gray; đỏ chỉ dành cho failed thật. */
.l11-mention-status--done    { background: var(--success-tint, #d1fae5); color: var(--on-success, #065f46); }
.l11-mention-status--expired { background: var(--bg-elevated, #eceff1); color: var(--text-secondary, #607d8b); }
.l11-mention-status--pending { background: var(--warning-tint, #fef3c7); color: var(--on-warning, #92400e); }
.l11-mention-status--failed,
.l11-mention-status--error   { background: var(--danger-tint, #fecaca); color: var(--on-danger, #991b1b); }
.l11-mention-status--processing { background: var(--info-tint, #dbeafe); color: var(--on-info, #1e40af); }

/* 5A effort panel */
.l11-effort-5a {
  margin-top: 6px; font-size: 12px;
  background: var(--success-tint, rgba(76, 175, 80, 0.08));
  border-radius: 4px; padding: 6px 10px;
}
.l11-effort-5a summary {
  cursor: pointer; font-weight: 600; color: var(--success, #10b981);
}
.l11-5a-row {
  margin: 4px 0; line-height: 1.4; color: var(--text-secondary);
}
.l11-5a-row strong { color: var(--text-primary); }

/* Mobile responsive */
@media (max-width: 600px) {
  .l11-hyp-grid { grid-template-columns: 1fr; }
  .l11-mention-row {
    grid-template-columns: 60px 80px 14px 80px 1fr 60px;
    font-size: 10px;
  }
  .l11-agent-lane { grid-template-columns: 80px 1fr auto; }
}
